`include "Func.v"

module ins_rom (
	input	clka,
	input	ena,
	// input	we,

	// input	data_in,
	output 	reg	[21:0] douta,

	input	[9:0]	addra

	
);
	always@(posedge clka)
	begin
		if(ena)
		begin
			case(addra)
//KenGen 768      *************************************************************************//
                 10'd0: douta <= `void_inst ;
				 10'd1:	douta <= {3'b101 ,4'd9, 4'd0 ,4'd9,`SHA3_Enable,6'B000001}; //G（Seed）
                 10'd2:	douta <= {3'b100 ,4'd10, 4'd0 ,4'd0,`SHA3_Enable,6'B010010}; //采样s2
                 10'd3:	douta <= {3'b100 ,4'd10, 4'd0 ,4'd1,`SHA3_Enable,6'B010001}; //采样s1
                 10'd4:	douta <= {3'b100 ,4'd10, 4'd0 ,4'd2,`SHA3_Enable,6'B010000}; //采样s0

                 10'd5: douta <= {`R1_TO_R2 ,4'd0, 4'd0 ,4'd1,`Poly_Enable,`NTT}; //NTT s2
                 10'd6: douta <= {`R1_TO_R2 ,4'd1, 4'd0 ,4'd2,`Poly_Enable,`NTT}; //NTT s2
                 10'd7: douta <= {`R1_TO_R2 ,4'd2, 4'd0 ,4'd3,`Poly_Enable,`NTT}; //NTT s2

                 10'd8: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101010}; //采样 A22
                 10'd9: douta <= {`R2_TO_R1 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //A22 s2  PWM1
                 10'd10: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd4,`Poly_Enable,`PWM2};   //A22 s2  PWM2

                 10'd11: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101001}; //采样 A21
                 10'd12: douta <= {`R2_TO_R1 ,4'd0, 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //A21 s1  PWM1
                 10'd13: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //A21 s1  PWM2

                 10'd14: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101000}; //采样 A20
                 10'd15: douta <= {`R2_TO_R1 ,4'd0, 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //A20 s0  PWM1
                 10'd16: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //A20 s0  PWM2

                 10'd17: douta <= {3'b100 ,4'd10, 4'd0 ,4'd0,`SHA3_Enable,6'B010101}; //采样e2
                 10'd18: douta <= {`R1_TO_R2 ,4'd0, 4'd0 ,4'd0,`Poly_Enable,`NTT};    //NTT e2

                 10'd19: douta <= {`R22_TO_R1,4'd0,4'd4,4'd0,`Poly_Enable,`PolyAdd};
                 10'd20: douta <= {`R22_TO_R1,4'd5,4'd6,4'd1,`Poly_Enable,`PolyAdd};
                 10'd21: douta <= {`R11_TO_R2,4'd0,4'd1,4'd9,`Poly_Enable,`PolyAdd}; // t2


                 10'd22: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100110}; //采样 A12
                 10'd23: douta <= {`R2_TO_R1 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //A12 s2  PWM1
                 10'd24: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd4,`Poly_Enable,`PWM2};   //A12 s2  PWM2

                 10'd25: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100101}; //采样 A11
                 10'd26: douta <= {`R2_TO_R1 ,4'd0, 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //A11 s1  PWM1
                 10'd27: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //A11 s1  PWM2

                 10'd28: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100100}; //采样 A10
                 10'd29: douta <= {`R2_TO_R1 ,4'd0, 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //A10 s0  PWM1
                 10'd30: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //A10 s0  PWM2

                 10'd31: douta <= {3'b100 ,4'd10, 4'd0 ,4'd0,`SHA3_Enable,6'B010100}; //采样e1
                 10'd32: douta <= {`R1_TO_R2 ,4'd0, 4'd0 ,4'd0,`Poly_Enable,`NTT};    //NTT e1

                 10'd33: douta <= {`R22_TO_R1,4'd0,4'd4,4'd0,`Poly_Enable,`PolyAdd};
                 10'd34: douta <= {`R22_TO_R1,4'd5,4'd6,4'd1,`Poly_Enable,`PolyAdd};
                 10'd35: douta <= {`R11_TO_R2,4'd0,4'd1,4'd8,`Poly_Enable,`PolyAdd}; //t1

                 10'd36: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100010}; //采样 A02
                 10'd37: douta <= {`R2_TO_R1 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //A02 s2  PWM1
                 10'd38: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd4,`Poly_Enable,`PWM2};   //A02 s2  PWM2

                 10'd39: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100001}; //采样 A01
                 10'd40: douta <= {`R2_TO_R1 ,4'd0, 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //A01 s1  PWM1
                 10'd41: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //A01 s1  PWM2

                 10'd42: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100000}; //采样 A00
                 10'd43: douta <= {`R2_TO_R1 ,4'd0, 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //A00 s0  PWM1
                 10'd44: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //A00 s0  PWM2

                 10'd45: douta <= {3'b100 ,4'd10, 4'd0 ,4'd0,`SHA3_Enable,6'B010011}; //采样e0
                 10'd46: douta <= {`R1_TO_R2 ,4'd0, 4'd0 ,4'd0,`Poly_Enable,`NTT};    //NTT e0

                 10'd47: douta <= {`R22_TO_R1,4'd0,4'd4,4'd0,`Poly_Enable,`PolyAdd};
                 10'd48: douta <= {`R22_TO_R1,4'd5,4'd6,4'd1,`Poly_Enable,`PolyAdd};
                 10'd49: douta <= {`R11_TO_R2,4'd0,4'd1,4'd7,`Poly_Enable,`PolyAdd}; //t0

                 10'd50: douta <= `void_inst ;
//****************************************************************************************//

//Enc 768      *************************************************************************//
                 10'd51: douta <= {3'b101 ,4'd8, 4'd0 ,4'd8,`SHA3_Enable,6'b110000}; //H（m） 
                 10'd52: douta <= {3'b111 ,4'd7, 4'd9 ,4'd10,`SHA3_Enable,6'b110010}; //H（pk） 
                 10'd53: douta <= {3'b111 ,4'd8, 4'd10 ,4'd11,`SHA3_Enable,6'b000010}; //G(m|Hpk)

                 10'd54: douta <= {3'b100 ,4'd12, 4'd0 ,4'd0,`SHA3_Enable,6'B010010}; //采样r2
                 10'd55: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010001}; //采样r1
                 10'd56: douta <= {3'b100 ,4'd12, 4'd0 ,4'd2,`SHA3_Enable,6'B010000}; //采样r0

                 10'd57: douta <= {`R1_TO_R2 ,4'd0, 4'd0 ,4'd1,`Poly_Enable,`NTT}; //NTT r2
                 10'd58: douta <= {`R1_TO_R2 ,4'd1, 4'd0 ,4'd2,`Poly_Enable,`NTT}; //NTT r1
                 10'd59: douta <= {`R1_TO_R2 ,4'd2, 4'd0 ,4'd3,`Poly_Enable,`NTT}; //NTT r0

                 10'd60: douta <= {`R2_TO_R1 ,4'd1, 4'd9 ,4'd0,`Poly_Enable,`PWM1};   //t2 r2  PWM1
                 10'd61: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd4,`Poly_Enable,`PWM2};   //t2 r2  PWM2

                 10'd62: douta <= {`R2_TO_R1 ,4'd2, 4'd8 ,4'd0,`Poly_Enable,`PWM1};   //t1 r1  PWM1
                 10'd63: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //t1 r1  PWM2

                 10'd64: douta <= {`R2_TO_R1 ,4'd3, 4'd7 ,4'd0,`Poly_Enable,`PWM1};   //t0 r0  PWM1
                 10'd65: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //t0 r0  PWM2

                 10'd66: douta <= {`R22_TO_R1,4'd4,4'd5,4'd0,`Poly_Enable,`PolyAdd};
                 10'd67: douta <= {`R12_TO_R2,4'd0,4'd6,4'd0,`Poly_Enable,`PolyAdd}; //tr2 + tr1 +tr0
                 
                 10'd68: douta <= {`R2_TO_R1 ,4'd0, 4'd0 ,4'd0,`Poly_Enable,`INTT};  //INTT tr
                 10'd69: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010110}; //采样 epp
                 10'd70: douta <= {3'B000 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`Encode_ADD}; //加密
                 10'd71: douta <= {`R2_TO_R1 ,4'd0, 4'd0 ,4'd7,`Poly_Enable,`Compress4}; //compress4

                //AT 22r2 + AT 21r1 + AT 20r0
                 10'd72: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101010}; //采样 AT22
                 10'd73: douta <= {`R2_TO_R1 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //A22 s2  PWM1
                 10'd74: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd4,`Poly_Enable,`PWM2};   //A22 s2  PWM2

                 10'd75: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100110}; //采样 AT21
                 10'd76: douta <= {`R2_TO_R1 ,4'd0, 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //AT21 r1  PWM1
                 10'd77: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //AT21 r1  PWM2

                 10'd78: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100010}; //采样 AT20
                 10'd79: douta <= {`R2_TO_R1 ,4'd0, 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //AT20 r0  PWM1
                 10'd80: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //AT20 r0  PWM2

                 10'd81: douta <= {`R22_TO_R1,4'd4,4'd5,4'd0,`Poly_Enable,`PolyAdd};  //AT22r2 + AT21r1
                 10'd82: douta <= {`R12_TO_R2,4'd0,4'd6,4'd0,`Poly_Enable,`PolyAdd};  //AT22r2 + AT21r1 + AT20r0
                 10'd83: douta <= {`R2_TO_R1 ,4'd0,4'd0,4'd0,`Poly_Enable,`INTT};

                 10'd84: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010101}; //采样e2
                 10'd85: douta <= {`R11_TO_R2,4'd0,4'd1,4'd4,`Poly_Enable,`PolyAdd}; //u[2]+e[2]
                 10'd86: douta <= {`R2_TO_R1,4'd4,4'd0,4'd6,`Poly_Enable,`Compress10}; //Compress10

                 //AT 12r2 + AT 11r1 + AT 10r0
                 10'd87: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101001}; //采样 AT12
                 10'd88: douta <= {`R2_TO_R1 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //A12 s2  PWM1
                 10'd89: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd4,`Poly_Enable,`PWM2};   //A12 s2  PWM2

                 10'd90: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100101}; //采样 AT11
                 10'd91: douta <= {`R2_TO_R1 ,4'd0, 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //AT11 r1  PWM1
                 10'd92: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //AT11 r1  PWM2

                 10'd93: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100001}; //采样 AT10
                 10'd94: douta <= {`R2_TO_R1 ,4'd0, 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //AT10 r0  PWM1
                 10'd95: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //AT10 r0  PWM2

                 10'd96: douta <= {`R22_TO_R1,4'd4,4'd5,4'd0,`Poly_Enable,`PolyAdd};  //AT12r2 + AT11r1
                 10'd97: douta <= {`R12_TO_R2,4'd0,4'd6,4'd0,`Poly_Enable,`PolyAdd};  //AT12r2 + AT11r1 + AT10r0
                 10'd98: douta <= {`R2_TO_R1 ,4'd0,4'd0,4'd0,`Poly_Enable,`INTT};

                 10'd99: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010100}; //采样e1
                 10'd100: douta <= {`R11_TO_R2,4'd0,4'd1,4'd4,`Poly_Enable,`PolyAdd}; //u[1]+e[1]
                 10'd101: douta <= {`R2_TO_R1,4'd4,4'd0,4'd5,`Poly_Enable,`Compress10}; //Compress10

                 //AT 02r2 + AT 01r1 + AT 00r0
                 10'd102: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101000}; //采样 AT02
                 10'd103: douta <= {`R2_TO_R1 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //A02 s2  PWM1
                 10'd104: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd4,`Poly_Enable,`PWM2};   //A02 s2  PWM2

                 10'd105: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100100}; //采样 AT01
                 10'd106: douta <= {`R2_TO_R1 ,4'd0, 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //AT01 r1  PWM1
                 10'd107: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //AT01 r1  PWM2

                 10'd108: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100000}; //采样 AT00
                 10'd109: douta <= {`R2_TO_R1 ,4'd0, 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //AT00 r0  PWM1
                 10'd110: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //AT00 r0  PWM2

                 10'd111: douta <= {`R22_TO_R1,4'd4,4'd5,4'd0,`Poly_Enable,`PolyAdd};  //AT02r2 + AT01r1
                 10'd112: douta <= {`R12_TO_R2,4'd0,4'd6,4'd0,`Poly_Enable,`PolyAdd};  //AT02r2 + AT01r1 + AT00r0
                 10'd113: douta <= {`R2_TO_R1 ,4'd0,4'd0,4'd0,`Poly_Enable,`INTT};

                 10'd114: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010011}; //采样e0
                 10'd115: douta <= {`R11_TO_R2,4'd0,4'd1,4'd4,`Poly_Enable,`PolyAdd}; //u[0]+e[0]
                 10'd116: douta <= {`R2_TO_R1,4'd4,4'd0,4'd4,`Poly_Enable,`Compress10}; //Compress10

                 10'd117: douta <= {3'b001,4'd4,4'd7,4'd12,`SHA3_Enable,6'b110101}; //Hc
                 10'd118: douta <= {3'b111,4'd11,4'd12,4'd11,`SHA3_Enable,6'b011110}; //KDF
                 
                 10'd119: douta <= `void_inst ;
//****************************************************************************************//

//Dec 768      *************************************************************************//

                 10'd120: douta <= {`R2_TO_R1,4'd10,4'd0,4'd4,`Poly_Enable,`Decompress10}; //Decompress10
                 10'd121: douta <= {`R2_TO_R1,4'd11,4'd0,4'd5,`Poly_Enable,`Decompress10}; //Decompress10
                 10'd122: douta <= {`R2_TO_R1,4'd12,4'd0,4'd6,`Poly_Enable,`Decompress10}; //Decompress10
                 10'd123: douta <= {`R2_TO_R1,4'd13,4'd0,4'd7,`Poly_Enable,`Decompress4}; //Decompress4

                 

                 10'd124: douta <= {`R1_TO_R2 ,4'd4, 4'd0 ,4'd4,`Poly_Enable,`NTT}; //NTT U0
                 10'd125: douta <= {`R1_TO_R2 ,4'd5, 4'd0 ,4'd5,`Poly_Enable,`NTT}; //NTT u1
                 10'd126: douta <= {`R1_TO_R2 ,4'd6, 4'd0 ,4'd6,`Poly_Enable,`NTT}; //NTT u2

                 10'd127: douta <= {`R2_TO_R1 ,4'd1, 4'd6 ,4'd0,`Poly_Enable,`PWM1};   //u2 s2  PWM1
                 10'd128: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //u2 s2  PWM2

                 10'd129: douta <= {`R2_TO_R1 ,4'd2, 4'd5 ,4'd0,`Poly_Enable,`PWM1};   //u1 s1  PWM1
                 10'd130: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //u1 s1  PWM2

                 10'd131: douta <= {`R2_TO_R1 ,4'd3, 4'd4 ,4'd0,`Poly_Enable,`PWM1};   //u0 s0  PWM1
                 10'd132: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd4,`Poly_Enable,`PWM2};   //u0 s0  PWM2
                 
                 10'd133: douta <= {`R22_TO_R1,4'd4,4'd5,4'd0,`Poly_Enable,`PolyAdd};  //u0s0 + u1s1
                 10'd134: douta <= {`R12_TO_R2,4'd0,4'd6,4'd0,`Poly_Enable,`PolyAdd};  //u0s0 + u1s1 + u2s2

                 10'd135: douta <= {`R2_TO_R1 ,4'd0,4'd0,4'd0,`Poly_Enable,`INTT}; //INTT
                // 10'd136: douta <= `void_inst;
                 10'd136: douta <= {3'B000 ,4'd0, 4'd7 ,4'd15,`Poly_Enable,`Decode_SUB}; //解密

                 //tr
                 10'd137: douta <= {3'b111 ,4'd7, 4'd9 ,4'd10,`SHA3_Enable,6'b110010}; //H（pk） 
                 10'd138: douta <= {3'b111 ,4'd8, 4'd10 ,4'd11,`SHA3_Enable,6'b000010}; //G(m|Hpk)
                 10'd139: douta <= {3'b100 ,4'd12, 4'd0 ,4'd0,`SHA3_Enable,6'B010010}; //采样r2

                 10'd140: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010001}; //采样r1
                 10'd141: douta <= {3'b100 ,4'd12, 4'd0 ,4'd2,`SHA3_Enable,6'B010000}; //采样r0
                 10'd142: douta <= {`R1_TO_R2 ,4'd0, 4'd0 ,4'd1,`Poly_Enable,`NTT}; //NTT r2

                 10'd143: douta <= {`R1_TO_R2 ,4'd1, 4'd0 ,4'd2,`Poly_Enable,`NTT}; //NTT r1
                 10'd144: douta <= {`R1_TO_R2 ,4'd2, 4'd0 ,4'd3,`Poly_Enable,`NTT}; //NTT r0
                 10'd145: douta <= {`R2_TO_R1 ,4'd1, 4'd9 ,4'd0,`Poly_Enable,`PWM1};   //t2 r2  PWM1

                 10'd146: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd4,`Poly_Enable,`PWM2};   //t2 r2  PWM2
                 10'd147: douta <= {`R2_TO_R1 ,4'd2, 4'd8 ,4'd0,`Poly_Enable,`PWM1};   //t1 r1  PWM1

                 10'd148: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //t1 r1  PWM2
                 10'd149: douta <= {`R2_TO_R1 ,4'd3, 4'd7 ,4'd0,`Poly_Enable,`PWM1};   //t0 r0  PWM1

                 10'd150: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //t0 r0  PWM2
                 10'd151: douta <= {`R22_TO_R1,4'd4,4'd5,4'd0,`Poly_Enable,`PolyAdd};

                 10'd152: douta <= {`R12_TO_R2,4'd0,4'd6,4'd0,`Poly_Enable,`PolyAdd}; //tr2 + tr1 +tr0
                 10'd153: douta <= {`R2_TO_R1 ,4'd0, 4'd0 ,4'd0,`Poly_Enable,`INTT};  //INTT tr
                 
                 10'd154: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010110}; //采样 epp
                 10'd155: douta <= {3'B000 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`Encode_ADD}; //加密 
                 10'd156: douta <= {3'B000 ,4'd0, 4'd13 ,4'd0,`Poly_Enable,`Compare4}; //比较 

                 //Ar3
                 10'd157: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101010}; //采样 AT22
                 10'd158: douta <= {`R2_TO_R1 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //A22 s2  PWM1
                 10'd159: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd4,`Poly_Enable,`PWM2};   //A22 s2  PWM2

                 10'd160: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100110}; //采样 AT21
                 10'd161: douta <= {`R2_TO_R1 ,4'd0, 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //AT21 r1  PWM1
                 10'd162: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //AT21 r1  PWM2

                 10'd163: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100010}; //采样 AT20
                 10'd164: douta <= {`R2_TO_R1 ,4'd0, 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //AT20 r0  PWM1
                 10'd165: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //AT20 r0  PWM2

                 10'd166: douta <= {`R22_TO_R1,4'd4,4'd5,4'd0,`Poly_Enable,`PolyAdd};  //AT22r2 + AT21r1
                 10'd167: douta <= {`R12_TO_R2,4'd0,4'd6,4'd0,`Poly_Enable,`PolyAdd};  //AT22r2 + AT21r1 + AT20r0
                 10'd168: douta <= {`R2_TO_R1 ,4'd0,4'd0,4'd0,`Poly_Enable,`INTT};

                 10'd169: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010101}; //采样e2
                 10'd170: douta <= {`R11_TO_R2,4'd0,4'd1,4'd4,`Poly_Enable,`PolyAdd}; //u[2]+e[2]
                 10'd171: douta <= {3'B000 ,4'd4, 4'd12 ,4'd0,`Poly_Enable,`Compare10}; //比较 


                 //AT 12r2 + AT 11r1 + AT 10r0
                 10'd172: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101001}; //采样 AT12
                 10'd173: douta <= {`R2_TO_R1 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //A12 s2  PWM1
                 10'd174: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd4,`Poly_Enable,`PWM2};   //A12 s2  PWM2

                 10'd175: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100101}; //采样 AT11
                 10'd176: douta <= {`R2_TO_R1 ,4'd0, 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //AT11 r1  PWM1
                 10'd177: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //AT11 r1  PWM2

                 10'd178: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100001}; //采样 AT10
                 10'd179: douta <= {`R2_TO_R1 ,4'd0, 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //AT10 r0  PWM1
                 10'd180: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //AT10 r0  PWM2

                 10'd181: douta <= {`R22_TO_R1,4'd4,4'd5,4'd0,`Poly_Enable,`PolyAdd};  //AT12r2 + AT11r1
                 10'd182: douta <= {`R12_TO_R2,4'd0,4'd6,4'd0,`Poly_Enable,`PolyAdd};  //AT12r2 + AT11r1 + AT10r0
                 10'd183: douta <= {`R2_TO_R1 ,4'd0,4'd0,4'd0,`Poly_Enable,`INTT};

                 10'd184: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010100}; //采样e1
                 10'd185: douta <= {`R11_TO_R2,4'd0,4'd1,4'd4,`Poly_Enable,`PolyAdd}; //u[1]+e[1]
                 10'd186: douta <= {3'B000 ,4'd4, 4'd11 ,4'd0,`Poly_Enable,`Compare10}; //比较 

                 //AT 02r2 + AT 01r1 + AT 00r0
                 10'd187: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101000}; //采样 AT02
                 10'd188: douta <= {`R2_TO_R1 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //A02 s2  PWM1
                 10'd189: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd4,`Poly_Enable,`PWM2};   //A02 s2  PWM2

                 10'd190: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100100}; //采样 AT01
                 10'd191: douta <= {`R2_TO_R1 ,4'd0, 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //AT01 r1  PWM1
                 10'd192: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //AT01 r1  PWM2

                 10'd193: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100000}; //采样 AT00
                 10'd194: douta <= {`R2_TO_R1 ,4'd0, 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //AT00 r0  PWM1
                 10'd195: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //AT00 r0  PWM2

                 10'd196: douta <= {`R22_TO_R1,4'd4,4'd5,4'd0,`Poly_Enable,`PolyAdd};  //AT02r2 + AT01r1
                 10'd197: douta <= {`R12_TO_R2,4'd0,4'd6,4'd0,`Poly_Enable,`PolyAdd};  //AT02r2 + AT01r1 + AT00r0
                 10'd198: douta <= {`R2_TO_R1 ,4'd0,4'd0,4'd0,`Poly_Enable,`INTT};

                 10'd199: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010011}; //采样e0
                 10'd200: douta <= {`R11_TO_R2,4'd0,4'd1,4'd4,`Poly_Enable,`PolyAdd}; //u[0]+e[0]
                 10'd201: douta <= {3'B000 ,4'd4, 4'd10 ,4'd0,`Poly_Enable,`Compare10}; //比较 

                 10'd202: douta <= {3'b111,4'd10,4'd13,4'd12,`SHA3_Enable,6'b110101}; //Hc
                 10'd203: douta <= {3'b111,4'd11,4'd12,4'd11,`SHA3_Enable,6'b011110}; //KDF

                 10'd204: douta <= `void_inst ;

//Keygen 512
                 10'd205: douta <= {3'b101 ,4'd9 , 4'd0 ,4'd9,`SHA3_Enable,6'B000001}; //G（Seed）

                 10'd206: douta <= {3'b100 ,4'd10, 4'd0 ,4'd0,`SHA3_Enable,6'B011001}; //采样s1
                 10'd207: douta <= {3'b100 ,4'd10, 4'd0 ,4'd1,`SHA3_Enable,6'B011000}; //采样s0 

                 10'd208: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100101}; //采样 A11   
                 10'd209: douta <= {3'b101 ,4'd9, 4'd0 ,4'd1,`SHA3_Enable,6'B100100}; //采样 A10  
                 10'd210: douta <= {3'b101 ,4'd9, 4'd0 ,4'd2,`SHA3_Enable,6'B100001}; //采样 A01  
                 10'd211: douta <= {3'b101 ,4'd9, 4'd0 ,4'd3,`SHA3_Enable,6'B100000}; //采样 A00   

                 10'd212: douta <= {`R1_TO_R2 ,4'd0, 4'd0 ,4'd4,`Poly_Enable,`NTT}; //NTT s1
                 10'd213: douta <= {`R1_TO_R2 ,4'd1, 4'd0 ,4'd5,`Poly_Enable,`NTT}; //NTT s0

                 10'd214: douta <= {`R2_TO_R1 ,4'd0, 4'd4 ,4'd0,`Poly_Enable,`PWM1};   //A11 s1  PWM1
                 10'd215: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //A11 s1  PWM2

                 10'd216: douta <= {`R2_TO_R1 ,4'd1, 4'd5 ,4'd0,`Poly_Enable,`PWM1};   //A10 s0  PWM1
                 10'd217: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd7,`Poly_Enable,`PWM2};   //A10 s0  PWM2

                 10'd218: douta <= {`R2_TO_R1 ,4'd2, 4'd4 ,4'd0,`Poly_Enable,`PWM1};   //A01 s1  PWM1
                 10'd219: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd8,`Poly_Enable,`PWM2};   //A01 s1  PWM2

                 10'd220: douta <= {`R2_TO_R1 ,4'd3, 4'd5 ,4'd0,`Poly_Enable,`PWM1};   //A00 s0  PWM1
                 10'd221: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd9,`Poly_Enable,`PWM2};   //A00 s0  PWM2

                 10'd222: douta <= {`R22_TO_R1,4'd6, 4'd7,4'd0,`Poly_Enable,`PolyAdd};  //A11s1 + A10s0 
                 10'd223: douta <= {`R22_TO_R1,4'd8, 4'd9,4'd1,`Poly_Enable,`PolyAdd};  //A01s1 + A00s0 

                 10'd224: douta <= {3'b101 ,4'd10, 4'd0 ,4'd6,`SHA3_Enable,6'B011011}; //采样e1
                 10'd225: douta <= {3'b101 ,4'd10, 4'd0 ,4'd7,`SHA3_Enable,6'B011010}; //采样e0

                 10'd226: douta <= {`R2_TO_R1 ,4'd6, 4'd0 ,4'd2,`Poly_Enable,`NTT}; //NTT e1
                 10'd227: douta <= {`R2_TO_R1 ,4'd7, 4'd0 ,4'd3,`Poly_Enable,`NTT}; //NTT e0  

                 10'd228: douta <= {`R11_TO_R2,4'd0,4'd2,4'd7,`Poly_Enable,`PolyAdd};  //A11s1 + A10s0 + e1
                 10'd229: douta <= {`R11_TO_R2,4'd1,4'd3,4'd6,`Poly_Enable,`PolyAdd};  //A01s1 + A00s0 + e0

                 10'd230: douta <= `void_inst ;       
//enc 512         **************************************************************//
               //  10'd231: douta <= {3'b101 ,4'd8, 4'd0 ,4'd8,`SHA3_Enable,6'b110000}; //H（m） 256bit
                 10'd231: douta <= {3'b000 ,4'd8, 4'd0 ,4'd8,`SHA3_Enable,6'b110000}; //H（m） 256bit
               //  10'd232: douta <= {3'b111 ,4'd10, 4'd9 ,4'd10,`SHA3_Enable,6'b110001}; //H（pk）  256bit
                 10'd232: douta <= {3'b000 ,4'd10, 4'd9 ,4'd10,`SHA3_Enable,6'b110001}; //H（pk）  256bit
               //  10'd233: douta <= {3'b111 ,4'd8, 4'd10 ,4'd11,`SHA3_Enable,6'b000010}; //G(m|Hpk) 512bit
                 10'd233: douta <= {3'b000 ,4'd8, 4'd10 ,4'd11,`SHA3_Enable,6'b000010}; //G(m|Hpk) 512bit

               //  10'd234: douta <= {3'b100 ,4'd12, 4'd0 ,4'd0,`SHA3_Enable,6'B011001}; //采样s1
                 10'd234: douta <= {3'b000 ,4'd12, 4'd0 ,4'd0,`SHA3_Enable,6'B011000}; //采样r0
                 10'd235: douta <= {3'b000 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B011001}; //采样r1 

                 10'd236: douta <= {3'b000 ,4'd9 , 4'd0 ,4'd2,`SHA3_Enable,6'B100000}; //采样 AT 00  ρ 
                 10'd237: douta <= {3'b000 ,4'd9 , 4'd0 ,4'd3,`SHA3_Enable,6'B100100}; //采样 AT 01  ρ
                 10'd238: douta <= {3'b000 ,4'd9 , 4'd0 ,4'd4,`SHA3_Enable,6'B100001}; //采样 AT 10  ρ
                 10'd239: douta <= {3'b000 ,4'd9 , 4'd0 ,4'd5,`SHA3_Enable,6'B100101}; //采样 AT 11  ρ

                 10'd240: douta <= {`R2_TO_R1 ,4'd0, 4'd0 ,4'd0,`Poly_Enable,`NTT}; //NTT r0 RAM2->0
                 10'd241: douta <= {`R2_TO_R1 ,4'd1, 4'd0 ,4'd1,`Poly_Enable,`NTT}; //NTT r1 RAM2->1

                 10'd242: douta <= {3'b100 ,4'd2, 4'd0 ,4'd0,`Poly_Enable,`PWM1};   //A00 r0  PWM1 
                 10'd243: douta <= {3'b001 ,4'd0, 4'd1 ,4'd2,`Poly_Enable,`PWM2};   //A00 r0  PWM2

                 10'd244: douta <= {3'b100 ,4'd3, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //A01 r1  PWM1
                 10'd245: douta <= {3'b001 ,4'd0, 4'd1 ,4'd3,`Poly_Enable,`PWM2};   //A01 r1  PWM2

                 10'd246: douta <= {3'b100 ,4'd4, 4'd0 ,4'd0,`Poly_Enable,`PWM1};   //A10 r0  PWM1
                 10'd247: douta <= {3'b001 ,4'd0, 4'd1 ,4'd4,`Poly_Enable,`PWM2};   //A10 r0  PWM2

                 10'd248: douta <= {3'b100 ,4'd5, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //A11 r1  PWM1
                 10'd249: douta <= {3'b001 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //A11 r1  PWM2

                 10'd250: douta <= {`R11_TO_R2,4'd3, 4'd2,4'd0,`Poly_Enable,`PolyAdd};  //A01r1 + A00r0 = u[0]
                 10'd251: douta <= {`R11_TO_R2,4'd5, 4'd4,4'd1,`Poly_Enable,`PolyAdd};  //A11r1 + A10r0 = u[1]

                 10'd252: douta <= {`R2_TO_R1,4'd0, 4'd0,4'd2,`Poly_Enable,`INTT};  //intt u[0]
                 10'd253: douta <= {`R2_TO_R1,4'd1, 4'd0,4'd3,`Poly_Enable,`INTT};  //intt u[1]

                 10'd254: douta <= {3'b000 ,4'd12, 4'd0 ,4'd6,`SHA3_Enable,6'B010010}; //采样e10
                 10'd255: douta <= {3'b000 ,4'd12, 4'd0 ,4'd7,`SHA3_Enable,6'B010011}; //采样e11

                 //2023.4.18到这

                 10'd256: douta <= {3'b100,4'd6, 4'd2,4'd0,`Poly_Enable,`PolyAdd};  //e1[0] + u[0]   RAM1+RAM2 ->RAM3 u0
                 10'd257: douta <= {3'b100,4'd7, 4'd3,4'd1,`Poly_Enable,`PolyAdd};  //e1[1] + u[1]   RAM1+RAM2 ->RAM3 u1

                 10'd258: douta <= {3'b100 ,4'd10, 4'd0 ,4'd2,`Poly_Enable,`PWM1};   //t0 r0  PWM1  RAM1+RAM2 ->RAM3
                 10'd259: douta <= {3'b001 ,4'd2, 4'd3 ,4'd4,`Poly_Enable,`PWM2};    //t0 r0  PWM2

                 10'd260: douta <= {3'b100 ,4'd11, 4'd1 ,4'd2,`Poly_Enable,`PWM1};   //t1 r1  PWM1
                 10'd261: douta <= {3'b001 ,4'd2, 4'd3 ,4'd5,`Poly_Enable,`PWM2};    //t1 r1  PWM2

                 10'd262: douta <= {`R11_TO_R2,4'd4, 4'd5,4'd2,`Poly_Enable,`PolyAdd};  //t0r0 + t1r1 = tr
                 10'd263: douta <= {`R2_TO_R1,4'd2, 4'd0,4'd2,`Poly_Enable,`INTT};  //intt tr
//                 10'd264: douta <= {`R2_TO_R1,4'd7, 4'd0,4'd0,`Poly_Enable,`PolyMov};  //mov v
                 10'd265: douta <= {3'b000 ,4'd12, 4'd0 ,4'd8,`SHA3_Enable,6'B010100}; //采样epp
                 10'd266: douta <= {3'b000 ,4'd2, 4'd8 ,4'd3,`Poly_Enable,`Encode_ADD}; //加密 tr+m+e2 RAM2+RAM1(m)+RAM1 = v

                 10'd267: douta <= {`R2_TO_R1 ,4'd0, 4'd0 ,4'd3,`Poly_Enable,`Compress10}; //Compress u0
                 10'd268: douta <= {`R2_TO_R1 ,4'd1, 4'd0 ,4'd4,`Poly_Enable,`Compress10}; //Compress u1
                 10'd269: douta <= {`R2_TO_R1 ,4'd3, 4'd0 ,4'd5,`Poly_Enable,`Compress4}; //Compress v

                 10'd270: douta <= {3'b110,4'd3,4'd5,4'd3,`SHA3_Enable,6'b110100}; //Hc
                 10'd271: douta <= {3'b000,4'd11,4'd3,4'd11,`SHA3_Enable,6'b011110}; //KDF


                 10'd272: douta <= `void_inst ;     
//dec512  **************************************************************//
                 10'd273: douta <= {`R2_TO_R1,4'd12,4'd0,4'd0,`Poly_Enable,`Decompress10}; //Decompress10
                 10'd274: douta <= {`R2_TO_R1,4'd13,4'd0,4'd1,`Poly_Enable,`Decompress10}; //Decompress10
                 10'd275: douta <= {`R2_TO_R1,4'd14,4'd0,4'd2,`Poly_Enable,`Decompress4}; //Decompress4

                // 10'd276: douta <= `void_inst ;
                 10'd276: douta <= {`R1_TO_R2 ,4'd0, 4'd0 ,4'd8,`Poly_Enable,`NTT}; //NTT u0
                 10'd277: douta <= {`R1_TO_R2 ,4'd1, 4'd0 ,4'd9,`Poly_Enable,`NTT}; //NTT u1 

                 10'd278: douta <= {`R2_TO_R1 ,4'd5, 4'd8 ,4'd0,`Poly_Enable,`PWM1};   //u0 s0  PWM1
                 10'd279: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd10,`Poly_Enable,`PWM2};  //u0 s0  PWM2

                 10'd280: douta <= {`R2_TO_R1 ,4'd4, 4'd9 ,4'd0,`Poly_Enable,`PWM1};   //u1 s1  PWM1
                 10'd281: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd11,`Poly_Enable,`PWM2};  //u1 s1  PWM2

                 10'd282: douta <= {`R22_TO_R1,4'd10, 4'd11,4'd3,`Poly_Enable,`PolyAdd};  //u1s1 + u0s0
                 10'd283: douta <= {`R1_TO_R2 ,4'd3, 4'd0 ,4'd10,`Poly_Enable,`INTT};      //INTT su
                 10'd284: douta <= {`R2_TO_R1,4'd10, 4'd0,4'd3,`Poly_Enable,`PolyMov};  //mov su

                 10'd285: douta <= {3'B000 ,4'd2, 4'd3 ,4'd15,`Poly_Enable,`Decode_SUB}; //解密

                 10'd286: douta <= {3'b111 ,4'd6, 4'd9 ,4'd10,`SHA3_Enable,6'b110001}; //H（pk） 
                 10'd287: douta <= {3'b111 ,4'd8, 4'd10 ,4'd11,`SHA3_Enable,6'b000010}; //G(m|Hpk)

                 10'd288: douta <= {3'b100 ,4'd12, 4'd0 ,4'd0,`SHA3_Enable,6'B011001}; //采样s1
                 10'd289: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B011000}; //采样s0 
                 10'd290: douta <= {`R1_TO_R2 ,4'd0, 4'd0 ,4'd4,`Poly_Enable,`NTT}; //NTT s1
                 10'd291: douta <= {`R1_TO_R2 ,4'd1, 4'd0 ,4'd5,`Poly_Enable,`NTT}; //NTT s0 

                 10'd292: douta <= {`R2_TO_R1 ,4'd7, 4'd4 ,4'd0,`Poly_Enable,`PWM1};   //t1 s1  PWM1
                 10'd293: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd8,`Poly_Enable,`PWM2};    //t1 s1  PWM2

                 10'd294: douta <= {`R2_TO_R1 ,4'd6, 4'd5 ,4'd0,`Poly_Enable,`PWM1};   //t0 s0  PWM1
                 10'd295: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd9,`Poly_Enable,`PWM2};    //t0 s0  PWM2
                 10'd296: douta <= {`R22_TO_R1,4'd8, 4'd9,4'd0,`Poly_Enable,`PolyAdd};  //t1s1 + t0s0
                 10'd297: douta <= {`R1_TO_R2,4'd0, 4'd0,4'd8,`Poly_Enable,`INTT};  //intt v
                 10'd298: douta <= {`R2_TO_R1,4'd8, 4'd0,4'd0,`Poly_Enable,`PolyMov};  //mov
                 10'd299: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010100}; //采样epp
                 10'd300: douta <= {3'B000 ,4'd0, 4'd1 ,4'd7,`Poly_Enable,`Encode_ADD}; //加密
                 10'd301: douta <= {3'B000 ,4'd7, 4'd14 ,4'd0,`Poly_Enable,`Compare4}; //比较 

                 10'd302: douta <= {`R2_TO_R1 ,4'd0, 4'd4 ,4'd0,`Poly_Enable,`PWM1};   //A11 s1  PWM1
                 10'd303: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //A11 s1  PWM2

                 10'd304: douta <= {`R2_TO_R1 ,4'd2, 4'd5 ,4'd0,`Poly_Enable,`PWM1};   //A10 s0  PWM1
                 10'd305: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd7,`Poly_Enable,`PWM2};   //A10 s0  PWM2

                 10'd306: douta <= {`R2_TO_R1 ,4'd1, 4'd4 ,4'd0,`Poly_Enable,`PWM1};   //A01 s1  PWM1
                 10'd307: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd8,`Poly_Enable,`PWM2};   //A01 s1  PWM2

                 10'd308: douta <= {`R2_TO_R1 ,4'd3, 4'd5 ,4'd0,`Poly_Enable,`PWM1};   //A00 s0  PWM1
                 10'd309: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd9,`Poly_Enable,`PWM2};   //A00 s0  PWM2

                 10'd310: douta <= {`R22_TO_R1,4'd6, 4'd7,4'd0,`Poly_Enable,`PolyAdd};  //A11s1 + A10s0 
                 10'd311: douta <= {`R22_TO_R1,4'd8, 4'd9,4'd1,`Poly_Enable,`PolyAdd};  //A01s1 + A00s0 

                 10'd312: douta <= {`R1_TO_R2,4'd0, 4'd7,4'd6,`Poly_Enable,`INTT};  //intt u[1]
                 10'd313: douta <= {`R1_TO_R2,4'd1, 4'd9,4'd7,`Poly_Enable,`INTT};  //intt u[0]

                 10'd314: douta <= {3'b100 ,4'd12, 4'd0 ,4'd0,`SHA3_Enable,6'B010011}; //采样e1
                 10'd315: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010010}; //采样e0

                 10'd316: douta <= {`R12_TO_R2,4'd0, 4'd6,4'd8,`Poly_Enable,`PolyAdd};  //u[1] + e[1] 
                 10'd317: douta <= {`R12_TO_R2,4'd1, 4'd7,4'd9,`Poly_Enable,`PolyAdd};  //u[0] + e[0]
                 10'd318: douta <= {3'B000 ,4'd8, 4'd13 ,4'd1,`Poly_Enable,`Compare10}; //比较 u1
                 10'd319: douta <= {3'B000 ,4'd9, 4'd12 ,4'd0,`Poly_Enable,`Compare10}; //比较 u0

                 10'd320: douta <= {3'b111,4'd12,4'd14,4'd12,`SHA3_Enable,6'b110100}; //Hc
                 10'd321: douta <= {3'b111,4'd11,4'd12,4'd11,`SHA3_Enable,6'b011110}; //KDF
                 10'd322: douta <= `void_inst ;

//**keygen 1024 ****************************************************************//
                 10'd323: douta <= {3'b101 ,4'd9, 4'd0 ,4'd9,`SHA3_Enable,6'B000001}; //G（Seed）
                 10'd324: douta <= {3'b100 ,4'd10, 4'd0 ,4'd0,`SHA3_Enable,6'B010011}; //采样s3
                 10'd325: douta <= {3'b100 ,4'd10, 4'd0 ,4'd1,`SHA3_Enable,6'B010010}; //采样s2
                 10'd326: douta <= {3'b100 ,4'd10, 4'd0 ,4'd2,`SHA3_Enable,6'B010001}; //采样s1
                 10'd327: douta <= {3'b100 ,4'd10, 4'd0 ,4'd3,`SHA3_Enable,6'B010000}; //采样s0

                 10'd328: douta <= {`R1_TO_R2 ,4'd0, 4'd0 ,4'd1,`Poly_Enable,`NTT}; //NTT s3
                 10'd329: douta <= {`R1_TO_R2 ,4'd1, 4'd0 ,4'd2,`Poly_Enable,`NTT}; //NTT s2
                 10'd330: douta <= {`R1_TO_R2 ,4'd2, 4'd0 ,4'd3,`Poly_Enable,`NTT}; //NTT s1
                 10'd331: douta <= {`R1_TO_R2 ,4'd3, 4'd0 ,4'd4,`Poly_Enable,`NTT}; //NTT s0

                 //A33 s3 + A32 s2 + A31 s1 + A30 s0
                 10'd332: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101111}; //采样 AT33
                 10'd333: douta <= {`R2_TO_R1 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //A33 s3  PWM1
                 10'd334: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //A33 s3  PWM2

                 10'd335: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101110}; //采样 AT32
                 10'd336: douta <= {`R2_TO_R1 ,4'd0, 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //A32 s2  PWM1
                 10'd337: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //A32 s2  PWM2

                 10'd338: douta <= {`R22_TO_R1,4'd5, 4'd6,4'd2,`Poly_Enable,`PolyAdd}; //A33 s3  + A32 s2

                 10'd339: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101101}; //采样 AT31
                 10'd340: douta <= {`R2_TO_R1 ,4'd0, 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //A31 s1  PWM1
                 10'd341: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //A31 s1  PWM2

                 10'd342: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101100}; //采样 AT30
                 10'd343: douta <= {`R2_TO_R1 ,4'd0, 4'd4 ,4'd0,`Poly_Enable,`PWM1};   //A30 s0  PWM1
                 10'd344: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //A30 s0  PWM2

                 10'd345: douta <= {`R22_TO_R1,4'd5, 4'd6,4'd3,`Poly_Enable,`PolyAdd}; //A31 s1  + A30 s0

                 10'd346: douta <= {`R11_TO_R2,4'd2, 4'd3,4'd5,`Poly_Enable,`PolyAdd}; //A33 s3  + A32 s2 + A31 s1  + A30 s0

                 10'd347: douta <= {3'b101 ,4'd10, 4'd0 ,4'd0,`SHA3_Enable,6'B010111};  //采样 e3
                 10'd348: douta <= {`R2_TO_R1 ,4'd0, 4'd0 ,4'd0,`Poly_Enable,`NTT};     //NTT  e3
                 10'd349: douta <= {`R12_TO_R2,4'd0, 4'd5,4'd10,`Poly_Enable,`PolyAdd}; //t[3]

                 //A23 s3 + A22 s2 + A21 s1 + A20 s0
                 10'd350: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101011}; //采样 AT23
                 10'd351: douta <= {`R2_TO_R1 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //A23 s3  PWM1
                 10'd352: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //A23 s3  PWM2

                 10'd353: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101010}; //采样 AT22
                 10'd354: douta <= {`R2_TO_R1 ,4'd0, 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //A22 s2  PWM1
                 10'd355: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //A22 s2  PWM2

                 10'd356: douta <= {`R22_TO_R1,4'd5, 4'd6,4'd2,`Poly_Enable,`PolyAdd}; //A23 s3  + A22 s2

                 10'd357: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101001}; //采样 AT21
                 10'd358: douta <= {`R2_TO_R1 ,4'd0, 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //A21 s1  PWM1
                 10'd359: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //A21 s1  PWM2

                 10'd360: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101000}; //采样 AT20
                 10'd361: douta <= {`R2_TO_R1 ,4'd0, 4'd4 ,4'd0,`Poly_Enable,`PWM1};   //A20 s0  PWM1
                 10'd362: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //A20 s0  PWM2

                 10'd363: douta <= {`R22_TO_R1,4'd5, 4'd6,4'd3,`Poly_Enable,`PolyAdd}; //A21 s1  + A20 s0

                 10'd364: douta <= {`R11_TO_R2,4'd2, 4'd3,4'd5,`Poly_Enable,`PolyAdd}; //A23 s3  + A22 s2 + A21 s1  + A20 s0

                 10'd365: douta <= {3'b101 ,4'd10, 4'd0 ,4'd0,`SHA3_Enable,6'B010110};  //采样 e2
                 10'd366: douta <= {`R2_TO_R1 ,4'd0, 4'd0 ,4'd0,`Poly_Enable,`NTT};     //NTT  e2
                 10'd367: douta <= {`R12_TO_R2,4'd0, 4'd5,4'd9,`Poly_Enable,`PolyAdd}; //t[2]

                 //A13 s3 + A12 s2 + A11 s1 + A10 s0
                 10'd368: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100111}; //采样 AT13
                 10'd369: douta <= {`R2_TO_R1 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //A13 s3  PWM1
                 10'd370: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //A13 s3  PWM2

                 10'd371: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100110}; //采样 AT12
                 10'd372: douta <= {`R2_TO_R1 ,4'd0, 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //A12 s2  PWM1
                 10'd373: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //A12 s2  PWM2

                 10'd374: douta <= {`R22_TO_R1,4'd5, 4'd6,4'd2,`Poly_Enable,`PolyAdd}; //A13 s3  + A12 s2

                 10'd375: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100101}; //采样 AT11
                 10'd376: douta <= {`R2_TO_R1 ,4'd0, 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //A11 s1  PWM1
                 10'd377: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //A11 s1  PWM2

                 10'd378: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100100}; //采样 AT10
                 10'd379: douta <= {`R2_TO_R1 ,4'd0, 4'd4 ,4'd0,`Poly_Enable,`PWM1};   //A10 s0  PWM1
                 10'd380: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //A10 s0  PWM2

                 10'd381: douta <= {`R22_TO_R1,4'd5, 4'd6,4'd3,`Poly_Enable,`PolyAdd}; //A11 s1  + A10 s0

                 10'd382: douta <= {`R11_TO_R2,4'd2, 4'd3,4'd5,`Poly_Enable,`PolyAdd}; //A13 s3  + A12 s2 + A11 s1  + A10 s0

                 10'd383: douta <= {3'b101 ,4'd10, 4'd0 ,4'd0,`SHA3_Enable,6'B010101};  //采样 e1
                 10'd384: douta <= {`R2_TO_R1 ,4'd0, 4'd0 ,4'd0,`Poly_Enable,`NTT};     //NTT  e1
                 10'd385: douta <= {`R12_TO_R2,4'd0, 4'd5,4'd8,`Poly_Enable,`PolyAdd}; //t[1]

                 //A03 s3 + A02 s2 + A01 s1 + A00 s0
                 10'd386: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100011}; //采样 AT03
                 10'd387: douta <= {`R2_TO_R1 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //A13 s3  PWM1
                 10'd388: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //A13 s3  PWM2

                 10'd389: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100010}; //采样 AT12
                 10'd390: douta <= {`R2_TO_R1 ,4'd0, 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //A02 s2  PWM1
                 10'd391: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //A02 s2  PWM2

                 10'd392: douta <= {`R22_TO_R1,4'd5, 4'd6,4'd2,`Poly_Enable,`PolyAdd}; //A03 s3  + A02 s2

                 10'd393: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100001}; //采样 AT01
                 10'd394: douta <= {`R2_TO_R1 ,4'd0, 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //A01 s1  PWM1
                 10'd395: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //A01 s1  PWM2

                 10'd396: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100000}; //采样 AT00
                 10'd397: douta <= {`R2_TO_R1 ,4'd0, 4'd4 ,4'd0,`Poly_Enable,`PWM1};   //A00 s0  PWM1
                 10'd398: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //A00 s0  PWM2

                 10'd399: douta <= {`R22_TO_R1,4'd5, 4'd6,4'd3,`Poly_Enable,`PolyAdd}; //A01 s1  + A00 s0

                 10'd400: douta <= {`R11_TO_R2,4'd2, 4'd3,4'd5,`Poly_Enable,`PolyAdd}; //A03 s3  + A02 s2 + A01 s1  + A00 s0

                 10'd401: douta <= {3'b101 ,4'd10, 4'd0 ,4'd0,`SHA3_Enable,6'B010100};  //采样 e1
                 10'd402: douta <= {`R2_TO_R1 ,4'd0, 4'd0 ,4'd0,`Poly_Enable,`NTT};     //NTT  e0
                 10'd403: douta <= {`R12_TO_R2,4'd0, 4'd5,4'd7,`Poly_Enable,`PolyAdd}; //t[0]

                 10'd404: douta <= `void_inst ;

//****************************************************************************************//

//**enc 1024 ****************************************************************//
                 10'd405: douta <= {3'b101 ,4'd8, 4'd0 ,4'd8,`SHA3_Enable,6'b110000}; //H（m） 
                 10'd406: douta <= {3'b111 ,4'd7, 4'd9 ,4'd10,`SHA3_Enable,6'b110011}; //H（pk） 
                 10'd407: douta <= {3'b111 ,4'd8, 4'd10 ,4'd11,`SHA3_Enable,6'b000010}; //G(m|Hpk)

                 10'd408: douta <= {3'b100 ,4'd12, 4'd0 ,4'd0,`SHA3_Enable,6'B010011}; //采样s3
                 10'd409: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010010}; //采样s2
                 10'd410: douta <= {3'b100 ,4'd12, 4'd0 ,4'd2,`SHA3_Enable,6'B010001}; //采样s1
                 10'd411: douta <= {3'b100 ,4'd12, 4'd0 ,4'd3,`SHA3_Enable,6'B010000}; //采样s0

                 10'd412: douta <= {`R1_TO_R2 ,4'd0, 4'd0 ,4'd1,`Poly_Enable,`NTT}; //NTT s3
                 10'd413: douta <= {`R1_TO_R2 ,4'd1, 4'd0 ,4'd2,`Poly_Enable,`NTT}; //NTT s2
                 10'd414: douta <= {`R1_TO_R2 ,4'd2, 4'd0 ,4'd3,`Poly_Enable,`NTT}; //NTT s1
                 10'd415: douta <= {`R1_TO_R2 ,4'd3, 4'd0 ,4'd4,`Poly_Enable,`NTT}; //NTT s0

                 10'd416: douta <= {`R2_TO_R1 ,4'd10, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //t3 s3  PWM1
                 10'd417: douta <= {`R1_TO_R2 ,4'd0 , 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //t3 s3  PWM2

                 10'd418: douta <= {`R2_TO_R1 ,4'd9 , 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //t2 s2  PWM1
                 10'd419: douta <= {`R1_TO_R2 ,4'd0 , 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //t2 s2  PWM2
                 10'd420: douta <= {`R22_TO_R1,4'd5, 4'd6,4'd2,`Poly_Enable,`PolyAdd};  //t3 s3  + t2 s2

                 10'd421: douta <= {`R2_TO_R1 ,4'd8 , 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //t3 s3  PWM1
                 10'd422: douta <= {`R1_TO_R2 ,4'd0 , 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //t3 s3  PWM2

                 10'd423: douta <= {`R2_TO_R1 ,4'd7 , 4'd4 ,4'd0,`Poly_Enable,`PWM1};   //t2 s2  PWM1
                 10'd424: douta <= {`R1_TO_R2 ,4'd0 , 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //t2 s2  PWM2
                 10'd425: douta <= {`R22_TO_R1,4'd5, 4'd6,4'd3,`Poly_Enable,`PolyAdd};  //t1 s1  + t0 s0

                 10'd426: douta <= {`R11_TO_R2,4'd2, 4'd3,4'd5,`Poly_Enable,`PolyAdd}; //t3 s3  + t2 s2 + t1 s1  + t0 s0

                 10'd427: douta <= {`R2_TO_R1 ,4'd5 , 4'd4 ,4'd0,`Poly_Enable,`INTT}; //INTT tr
                 10'd428: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B011111}; //采样e3
                 10'd429: douta <= {3'b000,4'd0, 4'd1,4'd0,`Poly_Enable,`Encode_ADD}; //encode tr 
                 10'd430: douta <= {`R2_TO_R1,4'd0, 4'd0,4'd7,`Poly_Enable,`Compress5}; //compress4 tr 
                 
                 //Ar3
                 10'd431: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101111}; //采样 AT33
                 10'd432: douta <= {`R2_TO_R1 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //AT33 s3  PWM1
                 10'd433: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //AT33 s3  PWM2

                 10'd434: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101011}; //采样 AT32
                 10'd435: douta <= {`R2_TO_R1 ,4'd0, 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //AT32 s2  PWM1
                 10'd436: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //AT32 s2  PWM2

                 10'd437: douta <= {`R22_TO_R1,4'd5, 4'd6,4'd2,`Poly_Enable,`PolyAdd}; //AT33 s3  + A32 s2

                 10'd438: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100111}; //采样 AT31
                 10'd439: douta <= {`R2_TO_R1 ,4'd0, 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //AT31 s1  PWM1
                 10'd440: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //AT31 s1  PWM2

                 10'd441: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100011}; //采样 AT30
                 10'd442: douta <= {`R2_TO_R1 ,4'd0, 4'd4 ,4'd0,`Poly_Enable,`PWM1};   //AT30 s0  PWM1
                 10'd443: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //AT30 s0  PWM2

                 10'd444: douta <= {`R22_TO_R1,4'd5, 4'd6,4'd3,`Poly_Enable,`PolyAdd}; //AT31 s1  + AT30 s0

                 10'd445: douta <= {`R11_TO_R2,4'd2, 4'd3,4'd5,`Poly_Enable,`PolyAdd}; //AT33 s3  + AT32 s2 + AT31 s1  + AT30 s0
                 10'd446: douta <= {`R2_TO_R1 ,4'd5 , 4'd4 ,4'd0,`Poly_Enable,`INTT}; //INTT As3

                 10'd447: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010111};  //采样 e3
                 10'd448: douta <= {`R11_TO_R2,4'd0, 4'd1,4'd0,`Poly_Enable,`PolyAdd};  //t3
                 10'd449: douta <= {`R2_TO_R1,4'd0, 4'd1,4'd6,`Poly_Enable,`Compress11};//t3  Compress11

                 //Ar2
                 10'd450: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101110}; //采样 AT23
                 10'd451: douta <= {`R2_TO_R1 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //AT23 s3  PWM1
                 10'd452: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //AT23 s3  PWM2

                 10'd453: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101010}; //采样 AT22
                 10'd454: douta <= {`R2_TO_R1 ,4'd0, 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //AT22 s2  PWM1
                 10'd455: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //AT22 s2  PWM2

                 10'd456: douta <= {`R22_TO_R1,4'd5, 4'd6,4'd2,`Poly_Enable,`PolyAdd}; //AT23 s3  + A22 s2

                 10'd457: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100110}; //采样 AT21
                 10'd458: douta <= {`R2_TO_R1 ,4'd0, 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //AT21 s1  PWM1
                 10'd459: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //AT21 s1  PWM2

                 10'd460: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100010}; //采样 AT20
                 10'd461: douta <= {`R2_TO_R1 ,4'd0, 4'd4 ,4'd0,`Poly_Enable,`PWM1};   //AT20 s0  PWM1
                 10'd462: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //AT20 s0  PWM2

                 10'd463: douta <= {`R22_TO_R1,4'd5, 4'd6,4'd3,`Poly_Enable,`PolyAdd}; //AT21 s1  + AT20 s0

                 10'd464: douta <= {`R11_TO_R2,4'd2, 4'd3,4'd5,`Poly_Enable,`PolyAdd}; //AT23 s3  + AT22 s2 + AT21 s1  + AT20 s0
                 10'd465: douta <= {`R2_TO_R1 ,4'd5 , 4'd4 ,4'd0,`Poly_Enable,`INTT};  //INTT As2

                 10'd466: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010110};  //采样 e2
                 10'd467: douta <= {`R11_TO_R2,4'd0, 4'd1,4'd0,`Poly_Enable,`PolyAdd};  //t2
                 10'd468: douta <= {`R2_TO_R1,4'd0, 4'd1,4'd5,`Poly_Enable,`Compress11};//t2  Compress11

                 //Ar1
                 10'd469: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101101}; //采样 AT13
                 10'd470: douta <= {`R2_TO_R1 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //AT13 s3  PWM1
                 10'd471: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //AT13 s3  PWM2

                 10'd472: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101001}; //采样 AT12
                 10'd473: douta <= {`R2_TO_R1 ,4'd0, 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //AT12 s2  PWM1
                 10'd474: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //AT12 s2  PWM2

                 10'd475: douta <= {`R22_TO_R1,4'd5, 4'd6,4'd2,`Poly_Enable,`PolyAdd}; //AT13 s3  + A12 s2

                 10'd476: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100101}; //采样 AT11
                 10'd477: douta <= {`R2_TO_R1 ,4'd0, 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //AT11 s1  PWM1
                 10'd478: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //AT11 s1  PWM2

                 10'd479: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100001}; //采样 AT10
                 10'd480: douta <= {`R2_TO_R1 ,4'd0, 4'd4 ,4'd0,`Poly_Enable,`PWM1};   //AT10 s0  PWM1
                 10'd481: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //AT10 s0  PWM2

                 10'd482: douta <= {`R22_TO_R1,4'd5, 4'd6,4'd3,`Poly_Enable,`PolyAdd}; //AT11 s1  + AT10 s0

                 10'd483: douta <= {`R11_TO_R2,4'd2, 4'd3,4'd5,`Poly_Enable,`PolyAdd}; //AT13 s3  + AT12 s2 + AT11 s1  + AT10 s0
                 10'd484: douta <= {`R2_TO_R1 ,4'd5 , 4'd4 ,4'd0,`Poly_Enable,`INTT}; //INTT As1

                 10'd485: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010101};  //采样 e1
                 10'd486: douta <= {`R11_TO_R2,4'd0, 4'd1,4'd0,`Poly_Enable,`PolyAdd};  //t1
                 10'd487: douta <= {`R2_TO_R1,4'd0, 4'd1,4'd4,`Poly_Enable,`Compress11};//t1  Compress11

                 //Ar1
                 10'd488: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101100}; //采样 AT03
                 10'd489: douta <= {`R2_TO_R1 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //AT03 s3  PWM1
                 10'd490: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //AT03 s3  PWM2

                 10'd491: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101000}; //采样 AT02
                 10'd492: douta <= {`R2_TO_R1 ,4'd0, 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //AT02 s2  PWM1
                 10'd493: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //AT02 s2  PWM2

                 10'd494: douta <= {`R22_TO_R1,4'd5, 4'd6,4'd2,`Poly_Enable,`PolyAdd}; //AT13 s3  + A12 s2

                 10'd495: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100100}; //采样 AT01
                 10'd496: douta <= {`R2_TO_R1 ,4'd0, 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //AT01 s1  PWM1
                 10'd497: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //AT01 s1  PWM2

                 10'd498: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100000}; //采样 AT00
                 10'd499: douta <= {`R2_TO_R1 ,4'd0, 4'd4 ,4'd0,`Poly_Enable,`PWM1};   //AT00 s0  PWM1
                 10'd500: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //AT00 s0  PWM2

                 10'd501: douta <= {`R22_TO_R1,4'd5, 4'd6,4'd3,`Poly_Enable,`PolyAdd}; //AT01 s1  + AT00 s0

                 10'd502: douta <= {`R11_TO_R2,4'd2, 4'd3,4'd5,`Poly_Enable,`PolyAdd}; //AT03 s3  + AT02 s2 + AT01 s1  + AT00 s0
                 10'd503: douta <= {`R2_TO_R1 ,4'd5 , 4'd4 ,4'd0,`Poly_Enable,`INTT}; //INTT As0

                 10'd504: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010100};  //采样 e0
                 10'd505: douta <= {`R11_TO_R2,4'd0, 4'd1,4'd0,`Poly_Enable,`PolyAdd};  //t0
                 10'd506: douta <= {`R2_TO_R1,4'd0, 4'd1,4'd3,`Poly_Enable,`Compress11};//t0  Compress11

                 10'd507: douta <= {3'b001,4'd3,4'd7,4'd12,`SHA3_Enable,6'b110110}; //Hc
                 10'd508: douta <= {3'b111,4'd11,4'd12,4'd11,`SHA3_Enable,6'b011110}; //KDF


                 10'd509: douta <= `void_inst ;
//****************************************************************************************//

//**dec 1024 ****************************************************************//
                 

                 10'd508+2: douta <= {`R2_TO_R1,4'd11,4'd0,4'd3,`Poly_Enable,`Decompress11}; //Decompress11
                 10'd509+2: douta <= {`R2_TO_R1,4'd12,4'd0,4'd4,`Poly_Enable,`Decompress11}; //Decompress11
                 10'd510+2: douta <= {`R2_TO_R1,4'd13,4'd0,4'd5,`Poly_Enable,`Decompress11}; //Decompress11
                 10'd511+2: douta <= {`R2_TO_R1,4'd14,4'd0,4'd6,`Poly_Enable,`Decompress11}; //Decompress11
                 10'd512+2: douta <= {`R2_TO_R1,4'd6 ,4'd0,4'd7,`Poly_Enable,`Decompress5}; //Decompress5
   
                 10'd513+2: douta <= {`R1_TO_R2 ,4'd6, 4'd0 ,4'd0,`Poly_Enable,`NTT}; //NTT u3
                 10'd514+2: douta <= {`R2_TO_R1 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //u3 s3  PWM1
                 10'd515+2: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd1,`Poly_Enable,`PWM2};   //u3 s3  PWM2
   
                 10'd516+2: douta <= {`R1_TO_R2 ,4'd5, 4'd0 ,4'd0,`Poly_Enable,`NTT}; //NTT u2
                 10'd517+2: douta <= {`R2_TO_R1 ,4'd0, 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //u2 s2  PWM1
                 10'd518+2: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd2,`Poly_Enable,`PWM2};   //u2 s2  PWM2
   
                 10'd519+2: douta <= {`R1_TO_R2 ,4'd4, 4'd0 ,4'd0,`Poly_Enable,`NTT}; //NTT u1
                 10'd520+2: douta <= {`R2_TO_R1 ,4'd0, 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //u1 s1  PWM1
                 10'd521+2: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd3,`Poly_Enable,`PWM2};   //u1 s1  PWM2
   
                 10'd522+2: douta <= {`R1_TO_R2 ,4'd3, 4'd0 ,4'd0,`Poly_Enable,`NTT}; //NTT u0
                 10'd523+2: douta <= {`R2_TO_R1 ,4'd0, 4'd4 ,4'd0,`Poly_Enable,`PWM1};   //u0 s0  PWM1
                 10'd524+2: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd4,`Poly_Enable,`PWM2};   //u0 s0  PWM2
   
                 10'd525+2: douta <= {`R22_TO_R1,4'd1, 4'd2,4'd0,`Poly_Enable,`PolyAdd}; //u3 s3 + u2 s2
                 10'd526+2: douta <= {`R22_TO_R1,4'd3, 4'd4,4'd1,`Poly_Enable,`PolyAdd}; //u1 s1 + u0 s0
                 10'd527+2: douta <= {`R11_TO_R2,4'd0, 4'd1,4'd0,`Poly_Enable,`PolyAdd}; //u1 s1 + u0 s0
                 10'd528+2: douta <= {`R2_TO_R1 ,4'd0, 4'd0 ,4'd0,`Poly_Enable,`INTT};   //INTT su
                 10'd529+2: douta <= {3'B000 ,4'd0, 4'd7 ,4'd15,`Poly_Enable,`Decode_SUB}; //解密


                 //10'd530: douta <= {3'b101 ,4'd8, 4'd0 ,4'd8,`SHA3_Enable,6'b110000}; //H（m） 
                 10'd530+2: douta <= {3'b111 ,4'd7, 4'd9 ,4'd10,`SHA3_Enable,6'b110011}; //H（pk） 
                 10'd531+2: douta <= {3'b111 ,4'd8, 4'd10 ,4'd11,`SHA3_Enable,6'b000010}; //G(m|Hpk)
                 //tr
                 10'd530+4: douta <= {3'b100 ,4'd12, 4'd0 ,4'd0,`SHA3_Enable,6'B010011}; //采样s3
                 10'd531+4: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010010}; //采样s2
                 10'd532+4: douta <= {3'b100 ,4'd12, 4'd0 ,4'd2,`SHA3_Enable,6'B010001}; //采样s1
                 10'd533+4: douta <= {3'b100 ,4'd12, 4'd0 ,4'd3,`SHA3_Enable,6'B010000}; //采样s0

                 10'd534+4: douta <= {`R1_TO_R2 ,4'd0, 4'd0 ,4'd1,`Poly_Enable,`NTT}; //NTT s3
                 10'd535+4: douta <= {`R1_TO_R2 ,4'd1, 4'd0 ,4'd2,`Poly_Enable,`NTT}; //NTT s2
                 10'd536+4: douta <= {`R1_TO_R2 ,4'd2, 4'd0 ,4'd3,`Poly_Enable,`NTT}; //NTT s1
                 10'd537+4: douta <= {`R1_TO_R2 ,4'd3, 4'd0 ,4'd4,`Poly_Enable,`NTT}; //NTT s0

                 10'd538+4: douta <= {`R2_TO_R1 ,4'd10, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //t3 s3  PWM1
                 10'd539+4: douta <= {`R1_TO_R2 ,4'd0 , 4'd1 ,4'd10,`Poly_Enable,`PWM2};   //t3 s3  PWM2

                 10'd540+4: douta <= {`R2_TO_R1 ,4'd9 , 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //t2 s2  PWM1
                 10'd541+4: douta <= {`R1_TO_R2 ,4'd0 , 4'd1 ,4'd9,`Poly_Enable,`PWM2};   //t2 s2  PWM2
                 10'd542+4: douta <= {`R22_TO_R1,4'd10, 4'd9 ,4'd2,`Poly_Enable,`PolyAdd};  //t3 s3  + t2 s2

                 10'd543+4: douta <= {`R2_TO_R1 ,4'd8 , 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //t3 s3  PWM1
                 10'd544+4: douta <= {`R1_TO_R2 ,4'd0 , 4'd1 ,4'd10,`Poly_Enable,`PWM2};   //t3 s3  PWM2

                 10'd545+4: douta <= {`R2_TO_R1 ,4'd7 , 4'd4 ,4'd0,`Poly_Enable,`PWM1};   //t2 s2  PWM1
                 10'd546+4: douta <= {`R1_TO_R2 ,4'd0 , 4'd1 ,4'd9,`Poly_Enable,`PWM2};   //t2 s2  PWM2
                 10'd547+4: douta <= {`R22_TO_R1,4'd10, 4'd9 ,4'd3,`Poly_Enable,`PolyAdd};  //t1 s1  + t0 s0

                 10'd548+4: douta <= {`R11_TO_R2,4'd2, 4'd3,4'd5,`Poly_Enable,`PolyAdd}; //t3 s3  + t2 s2 + t1 s1  + t0 s0

                 10'd549+4: douta <= {`R2_TO_R1 ,4'd5 , 4'd0 ,4'd0,`Poly_Enable,`INTT}; //INTT tr
                 10'd550+4: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B011111}; //采样e3
                 10'd551+4: douta <= {3'b000,4'd0, 4'd1,4'd0,`Poly_Enable,`Encode_ADD}; //encode tr 
                 10'd552+4: douta <= {3'b000,4'd0, 4'd6,4'd0,`Poly_Enable,`Compare5}; //compares4 tr 

                 //Ar3
                 10'd431+126: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101111}; //采样 AT33
                 10'd432+126: douta <= {`R2_TO_R1 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //AT33 s3  PWM1
                 10'd433+126: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd10,`Poly_Enable,`PWM2};   //AT33 s3  PWM2

                 10'd434+126: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101011}; //采样 AT32
                 10'd435+126: douta <= {`R2_TO_R1 ,4'd0, 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //AT32 s2  PWM1
                 10'd436+126: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd9,`Poly_Enable,`PWM2};   //AT32 s2  PWM2

                 10'd437+126: douta <= {`R22_TO_R1,4'd9, 4'd10,4'd2,`Poly_Enable,`PolyAdd}; //AT33 s3  + A32 s2

                 10'd438+126: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100111}; //采样 AT31
                 10'd439+126: douta <= {`R2_TO_R1 ,4'd0, 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //AT31 s1  PWM1
                 10'd440+126: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd10,`Poly_Enable,`PWM2};   //AT31 s1  PWM2

                 10'd441+126: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100011}; //采样 AT30
                 10'd442+126: douta <= {`R2_TO_R1 ,4'd0, 4'd4 ,4'd0,`Poly_Enable,`PWM1};   //AT30 s0  PWM1
                 10'd443+126: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd9,`Poly_Enable,`PWM2};   //AT30 s0  PWM2

                 10'd444+126: douta <= {`R22_TO_R1,4'd9, 4'd10,4'd3,`Poly_Enable,`PolyAdd}; //AT31 s1  + AT30 s0

                 10'd445+126: douta <= {`R11_TO_R2,4'd2, 4'd3,4'd5,`Poly_Enable,`PolyAdd}; //AT33 s3  + AT32 s2 + AT31 s1  + AT30 s0
                 10'd446+126: douta <= {`R2_TO_R1 ,4'd5 , 4'd4 ,4'd0,`Poly_Enable,`INTT}; //INTT As3

                 10'd447+126: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010111};  //采样 e3
                 10'd448+126: douta <= {`R11_TO_R2,4'd0, 4'd1,4'd0,`Poly_Enable,`PolyAdd};  //t3
                 10'd449+126: douta <= {3'b000,4'd0, 4'd14,4'd0,`Poly_Enable,`Compare11};//t3  Compare11    

                 //Ar2
                 10'd450+126: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101110}; //采样 AT23
                 10'd451+126: douta <= {`R2_TO_R1 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //AT23 s3  PWM1
                 10'd452+126: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd10,`Poly_Enable,`PWM2};   //AT23 s3  PWM2

                 10'd453+126: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101010}; //采样 AT22
                 10'd454+126: douta <= {`R2_TO_R1 ,4'd0, 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //AT22 s2  PWM1
                 10'd455+126: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd9,`Poly_Enable,`PWM2};   //AT22 s2  PWM2

                 10'd456+126: douta <= {`R22_TO_R1,4'd9, 4'd10,4'd2,`Poly_Enable,`PolyAdd}; //AT23 s3  + A22 s2

                 10'd457+126: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100110}; //采样 AT21
                 10'd458+126: douta <= {`R2_TO_R1 ,4'd0, 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //AT21 s1  PWM1
                 10'd459+126: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd10,`Poly_Enable,`PWM2};   //AT21 s1  PWM2

                 10'd460+126: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100010}; //采样 AT20
                 10'd461+126: douta <= {`R2_TO_R1 ,4'd0, 4'd4 ,4'd0,`Poly_Enable,`PWM1};   //AT20 s0  PWM1
                 10'd462+126: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd9,`Poly_Enable,`PWM2};   //AT20 s0  PWM2

                 10'd463+126: douta <= {`R22_TO_R1,4'd9, 4'd10,4'd3,`Poly_Enable,`PolyAdd}; //AT21 s1  + AT20 s0

                 10'd464+126: douta <= {`R11_TO_R2,4'd2, 4'd3,4'd5,`Poly_Enable,`PolyAdd}; //AT23 s3  + AT22 s2 + AT21 s1  + AT20 s0
                 10'd465+126: douta <= {`R2_TO_R1 ,4'd5 , 4'd4 ,4'd0,`Poly_Enable,`INTT};  //INTT As2

                 10'd466+126: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010110};  //采样 e2
                 10'd467+126: douta <= {`R11_TO_R2,4'd0, 4'd1,4'd0,`Poly_Enable,`PolyAdd};  //t2
                 10'd468+126: douta <= {3'b000,4'd0, 4'd13,4'd0,`Poly_Enable,`Compare11};//t2  Compare11

                 //Ar1
                 10'd469+126: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101101}; //采样 AT13
                 10'd470+126: douta <= {`R2_TO_R1 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //AT13 s3  PWM1
                 10'd471+126: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd10,`Poly_Enable,`PWM2};   //AT13 s3  PWM2

                 10'd472+126: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101001}; //采样 AT12
                 10'd473+126: douta <= {`R2_TO_R1 ,4'd0, 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //AT12 s2  PWM1
                 10'd474+126: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd9,`Poly_Enable,`PWM2};   //AT12 s2  PWM2

                 10'd475+126: douta <= {`R22_TO_R1,4'd9, 4'd10,4'd2,`Poly_Enable,`PolyAdd}; //AT13 s3  + A12 s2

                 10'd476+126: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100101}; //采样 AT11
                 10'd477+126: douta <= {`R2_TO_R1 ,4'd0, 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //AT11 s1  PWM1
                 10'd478+126: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd10,`Poly_Enable,`PWM2};   //AT11 s1  PWM2

                 10'd479+126: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100001}; //采样 AT10
                 10'd480+126: douta <= {`R2_TO_R1 ,4'd0, 4'd4 ,4'd0,`Poly_Enable,`PWM1};   //AT10 s0  PWM1
                 10'd481+126: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd9,`Poly_Enable,`PWM2};   //AT10 s0  PWM2

                 10'd482+126: douta <= {`R22_TO_R1,4'd9, 4'd10,4'd3,`Poly_Enable,`PolyAdd}; //AT11 s1  + AT10 s0

                 10'd483+126: douta <= {`R11_TO_R2,4'd2, 4'd3,4'd5,`Poly_Enable,`PolyAdd}; //AT13 s3  + AT12 s2 + AT11 s1  + AT10 s0
                 10'd484+126: douta <= {`R2_TO_R1 ,4'd5 , 4'd4 ,4'd0,`Poly_Enable,`INTT}; //INTT As1

                 10'd485+126: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010101};  //采样 e1
                 10'd486+126: douta <= {`R11_TO_R2,4'd0, 4'd1,4'd0,`Poly_Enable,`PolyAdd};  //t1
                 10'd487+126: douta <= {`R2_TO_R1,4'd0, 4'd12,4'd0,`Poly_Enable,`Compare11};//t1  `Compare11

                 //Ar1+124
                 10'd488+126: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101100}; //采样 AT03
                 10'd489+126: douta <= {`R2_TO_R1 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //AT03 s3  PWM1
                 10'd490+126: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd10,`Poly_Enable,`PWM2};   //AT03 s3  PWM2

                 10'd491+126: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101000}; //采样 AT02
                 10'd492+126: douta <= {`R2_TO_R1 ,4'd0, 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //AT02 s2  PWM1
                 10'd493+126: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd9,`Poly_Enable,`PWM2};   //AT02 s2  PWM2

                 10'd494+126: douta <= {`R22_TO_R1,4'd9, 4'd10,4'd2,`Poly_Enable,`PolyAdd}; //AT13 s3  + A12 s2

                 10'd495+126: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100100}; //采样 AT01
                 10'd496+126: douta <= {`R2_TO_R1 ,4'd0, 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //AT01 s1  PWM1
                 10'd497+126: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd10,`Poly_Enable,`PWM2};   //AT01 s1  PWM2

                 10'd498+126: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100000}; //采样 AT00
                 10'd499+126: douta <= {`R2_TO_R1 ,4'd0, 4'd4 ,4'd0,`Poly_Enable,`PWM1};   //AT00 s0  PWM1
                 10'd500+126: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd9,`Poly_Enable,`PWM2};   //AT00 s0  PWM2

                 10'd501+126: douta <= {`R22_TO_R1,4'd9, 4'd10,4'd3,`Poly_Enable,`PolyAdd}; //AT01 s1  + AT00 s0

                 10'd502+126: douta <= {`R11_TO_R2,4'd2, 4'd3,4'd5,`Poly_Enable,`PolyAdd}; //AT03 s3  + AT02 s2 + AT01 s1  + AT00 s0
                 10'd503+126: douta <= {`R2_TO_R1 ,4'd5 , 4'd0 ,4'd0,`Poly_Enable,`INTT}; //INTT As0

                 10'd504+126: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010100};  //采样 e0
                 10'd505+126: douta <= {`R11_TO_R2,4'd0, 4'd1,4'd0,`Poly_Enable,`PolyAdd};  //t0
                 10'd506+126: douta <= {`R2_TO_R1,4'd0, 4'd11,4'd3,`Poly_Enable,`Compare11};//t0  `Compare11

                 10'd633: douta <= {3'b111,4'd11,4'd6,4'd12,`SHA3_Enable,6'b110110}; //Hc
                 10'd634: douta <= {3'b111,4'd11,4'd12,4'd11,`SHA3_Enable,6'b011110}; //KDF

                 10'd635: douta <= `void_inst ;
//****************************************************************************************//


//enc 512 pke
                 10'd636: douta <= {3'b100 ,4'd12, 4'd0 ,4'd0,`SHA3_Enable,6'B011001}; //采样s1
                 10'd235+402: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B011000}; //采样s0 
     
                 10'd236+402: douta <= {3'b101 ,4'd9 , 4'd0 ,4'd0,`SHA3_Enable,6'B100101}; //采样 AT 11   
                 10'd237+402: douta <= {3'b101 ,4'd9 , 4'd0 ,4'd1,`SHA3_Enable,6'B100001}; //采样 AT 10  
                 10'd238+402: douta <= {3'b101 ,4'd9 , 4'd0 ,4'd2,`SHA3_Enable,6'B100100}; //采样 AT 01  
                 10'd239+402: douta <= {3'b101 ,4'd9 , 4'd0 ,4'd3,`SHA3_Enable,6'B100000}; //采样 AT 00  
     
                 10'd240+402: douta <= {`R1_TO_R2 ,4'd0, 4'd0 ,4'd4,`Poly_Enable,`NTT}; //NTT s1
                 10'd241+402: douta <= {`R1_TO_R2 ,4'd1, 4'd0 ,4'd5,`Poly_Enable,`NTT}; //NTT s0 
     
                 10'd242+402: douta <= {`R2_TO_R1 ,4'd0, 4'd4 ,4'd0,`Poly_Enable,`PWM1};   //A11 s1  PWM1
                 10'd243+402: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //A11 s1  PWM2
     
                 10'd244+402: douta <= {`R2_TO_R1 ,4'd1, 4'd5 ,4'd0,`Poly_Enable,`PWM1};   //A10 s0  PWM1
                 10'd245+402: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd7,`Poly_Enable,`PWM2};   //A10 s0  PWM2
     
                 10'd246+402: douta <= {`R2_TO_R1 ,4'd2, 4'd4 ,4'd0,`Poly_Enable,`PWM1};   //A01 s1  PWM1
                 10'd247+402: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd8,`Poly_Enable,`PWM2};   //A01 s1  PWM2
     
                 10'd248+402: douta <= {`R2_TO_R1 ,4'd3, 4'd5 ,4'd0,`Poly_Enable,`PWM1};   //A00 s0  PWM1
                 10'd249+402: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd9,`Poly_Enable,`PWM2};   //A00 s0  PWM2
     
                 10'd250+402: douta <= {`R22_TO_R1,4'd6, 4'd7,4'd0,`Poly_Enable,`PolyAdd};  //A11s1 + A10s0 
                 10'd251+402: douta <= {`R22_TO_R1,4'd8, 4'd9,4'd1,`Poly_Enable,`PolyAdd};  //A01s1 + A00s0 
     
                 10'd252+402: douta <= {`R1_TO_R2,4'd0, 4'd7,4'd6,`Poly_Enable,`INTT};  //intt u[1]
                 10'd253+402: douta <= {`R1_TO_R2,4'd1, 4'd9,4'd7,`Poly_Enable,`INTT};  //intt u[0]
     
                 10'd254+402: douta <= {3'b100 ,4'd12, 4'd0 ,4'd0,`SHA3_Enable,6'B010011}; //采样e1
                 10'd255+402: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010010}; //采样e0
     
                 10'd256+402: douta <= {`R12_TO_R2,4'd0, 4'd6,4'd8,`Poly_Enable,`PolyAdd};  //u[1] + e[1] 
                 10'd257+402: douta <= {`R12_TO_R2,4'd1, 4'd7,4'd9,`Poly_Enable,`PolyAdd};  //u[0] + e[0]
     
                 10'd258+402: douta <= {`R2_TO_R1 ,4'd10, 4'd5 ,4'd0,`Poly_Enable,`PWM1};   //t1 s1  PWM1
                 10'd259+402: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd7,`Poly_Enable,`PWM2};    //t1 s1  PWM2
     
                 10'd260+402: douta <= {`R2_TO_R1 ,4'd11, 4'd4 ,4'd0,`Poly_Enable,`PWM1};   //t0 s0  PWM1
                 10'd261+402: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};    //t0 s0  PWM2
                 10'd262+402: douta <= {`R22_TO_R1,4'd6, 4'd7,4'd0,`Poly_Enable,`PolyAdd};  //t1s1 + t0s0
                 10'd263+402: douta <= {`R1_TO_R2,4'd0, 4'd0,4'd7,`Poly_Enable,`INTT};  //intt v
                 10'd264+402: douta <= {`R2_TO_R1,4'd7, 4'd0,4'd0,`Poly_Enable,`PolyMov};  //mov v
                 10'd265+402: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010100}; //采样epp
                 10'd266+402: douta <= {3'B000 ,4'd0, 4'd1 ,4'd7,`Poly_Enable,`Encode_ADD}; //加密
     
                 10'd267+402: douta <= {`R2_TO_R1 ,4'd8, 4'd0 ,4'd1,`Poly_Enable,`Compress10}; //Compress
                 10'd268+402: douta <= {`R2_TO_R1 ,4'd9, 4'd0 ,4'd0,`Poly_Enable,`Compress10}; //Compress
                 10'd269+402: douta <= {`R2_TO_R1 ,4'd7, 4'd0 ,4'd2,`Poly_Enable,`Compress4}; //Compress 

                 10'd672: douta <= `void_inst ;      

//DEC 512 PKE
                 10'd673: douta <= {`R2_TO_R1,4'd12,4'd0,4'd0,`Poly_Enable,`Decompress10}; //Decompress10
                 10'd274+400: douta <= {`R2_TO_R1,4'd13,4'd0,4'd1,`Poly_Enable,`Decompress10}; //Decompress10
                 10'd275+400: douta <= {`R2_TO_R1,4'd14,4'd0,4'd2,`Poly_Enable,`Decompress4}; //Decompress4

                 10'd276+400: douta <= {`R1_TO_R2 ,4'd0, 4'd0 ,4'd8,`Poly_Enable,`NTT}; //NTT u0
                 10'd277+400: douta <= {`R1_TO_R2 ,4'd1, 4'd0 ,4'd9,`Poly_Enable,`NTT}; //NTT u1 

                 10'd278+400: douta <= {`R2_TO_R1 ,4'd4, 4'd8 ,4'd0,`Poly_Enable,`PWM1};   //u0 s0  PWM1
                 10'd279+400: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd10,`Poly_Enable,`PWM2};  //u0 s0  PWM2

                 10'd280+400: douta <= {`R2_TO_R1 ,4'd5, 4'd9 ,4'd0,`Poly_Enable,`PWM1};   //u1 s1  PWM1
                 10'd281+400: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd11,`Poly_Enable,`PWM2};  //u1 s1  PWM2

                 10'd282+400: douta <= {`R22_TO_R1,4'd10, 4'd11,4'd3,`Poly_Enable,`PolyAdd};  //u1s1 + u0s0
                 10'd283+400: douta <= {`R1_TO_R2 ,4'd3, 4'd0 ,4'd10,`Poly_Enable,`INTT};      //INTT su
                 10'd284+400: douta <= {`R2_TO_R1,4'd10, 4'd0,4'd3,`Poly_Enable,`PolyMov};  //mov su

                 10'd285+400: douta <= {3'B000 ,4'd2, 4'd3 ,4'd15,`Poly_Enable,`Decode_SUB}; //解密
                 10'd686: douta <= `void_inst ;

//enc 768 pke 
                 10'd687: douta <= {3'b100 ,4'd12, 4'd0 ,4'd0,`SHA3_Enable,6'B010010}; //采样r2
                 10'd55+633: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010001}; //采样r1
                 10'd56+633: douta <= {3'b100 ,4'd12, 4'd0 ,4'd2,`SHA3_Enable,6'B010000}; //采样r0
     
                 10'd57+633: douta <= {`R1_TO_R2 ,4'd0, 4'd0 ,4'd1,`Poly_Enable,`NTT}; //NTT r2
                 10'd58+633: douta <= {`R1_TO_R2 ,4'd1, 4'd0 ,4'd2,`Poly_Enable,`NTT}; //NTT r1
                 10'd59+633: douta <= {`R1_TO_R2 ,4'd2, 4'd0 ,4'd3,`Poly_Enable,`NTT}; //NTT r0
     
                 10'd60+633: douta <= {`R2_TO_R1 ,4'd1, 4'd9 ,4'd0,`Poly_Enable,`PWM1};   //t2 r2  PWM1
                 10'd61+633: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd4,`Poly_Enable,`PWM2};   //t2 r2  PWM2
     
                 10'd62+633: douta <= {`R2_TO_R1 ,4'd2, 4'd8 ,4'd0,`Poly_Enable,`PWM1};   //t1 r1  PWM1
                 10'd63+633: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //t1 r1  PWM2
     
                 10'd64+633: douta <= {`R2_TO_R1 ,4'd3, 4'd7 ,4'd0,`Poly_Enable,`PWM1};   //t0 r0  PWM1
                 10'd65+633: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //t0 r0  PWM2
     
                 10'd66+633: douta <= {`R22_TO_R1,4'd4,4'd5,4'd0,`Poly_Enable,`PolyAdd};
                 10'd67+633: douta <= {`R12_TO_R2,4'd0,4'd6,4'd0,`Poly_Enable,`PolyAdd}; //tr2 + tr1 +tr0
     
                 10'd68+633: douta <= {`R2_TO_R1 ,4'd0, 4'd0 ,4'd0,`Poly_Enable,`INTT};  //INTT tr
                 10'd69+633: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010110}; //采样 epp
                 10'd70+633: douta <= {3'B000 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`Encode_ADD}; //加密
                 10'd71+633: douta <= {`R2_TO_R1 ,4'd0, 4'd0 ,4'd7,`Poly_Enable,`Compress4}; //compress4
     
                //AT 22+633r2 + AT 21r1 + AT 20r0
                 10'd72+633: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101010}; //采样 AT22
                 10'd73+633: douta <= {`R2_TO_R1 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //A22 s2  PWM1
                 10'd74+633: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd4,`Poly_Enable,`PWM2};   //A22 s2  PWM2
     
                 10'd75+633: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100110}; //采样 AT21
                 10'd76+633: douta <= {`R2_TO_R1 ,4'd0, 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //AT21 r1  PWM1
                 10'd77+633: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //AT21 r1  PWM2
     
                 10'd78+633: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100010}; //采样 AT20
                 10'd79+633: douta <= {`R2_TO_R1 ,4'd0, 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //AT20 r0  PWM1
                 10'd80+633: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //AT20 r0  PWM2
     
                 10'd81+633: douta <= {`R22_TO_R1,4'd4,4'd5,4'd0,`Poly_Enable,`PolyAdd};  //AT22r2 + AT21r1
                 10'd82+633: douta <= {`R12_TO_R2,4'd0,4'd6,4'd0,`Poly_Enable,`PolyAdd};  //AT22r2 + AT21r1 + AT20r0
                 10'd83+633: douta <= {`R2_TO_R1 ,4'd0,4'd0,4'd0,`Poly_Enable,`INTT};
     
                 10'd84+633: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010101}; //采样e2
                 10'd85+633: douta <= {`R11_TO_R2,4'd0,4'd1,4'd4,`Poly_Enable,`PolyAdd}; //u[2]+e[2]
                 10'd86+633: douta <= {`R2_TO_R1,4'd4,4'd0,4'd6,`Poly_Enable,`Compress10}; //Compress10
     
                 //AT 1+6332r2 + AT 11r1 + AT 10r0
                 10'd87+633: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101001}; //采样 AT12
                 10'd88+633: douta <= {`R2_TO_R1 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //A12 s2  PWM1
                 10'd89+633: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd4,`Poly_Enable,`PWM2};   //A12 s2  PWM2
     
                 10'd90+633: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100101}; //采样 AT11
                 10'd91+633: douta <= {`R2_TO_R1 ,4'd0, 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //AT11 r1  PWM1
                 10'd92+633: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //AT11 r1  PWM2
     
                 10'd93+633: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100001}; //采样 AT10
                 10'd94+633: douta <= {`R2_TO_R1 ,4'd0, 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //AT10 r0  PWM1
                 10'd95+633: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //AT10 r0  PWM2
     
                 10'd96+633: douta <= {`R22_TO_R1,4'd4,4'd5,4'd0,`Poly_Enable,`PolyAdd};  //AT12r2 + AT11r1
                 10'd97+633: douta <= {`R12_TO_R2,4'd0,4'd6,4'd0,`Poly_Enable,`PolyAdd};  //AT12r2 + AT11r1 + AT10r0
                 10'd98+633: douta <= {`R2_TO_R1 ,4'd0,4'd0,4'd0,`Poly_Enable,`INTT};
     
                 10'd99+633: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010100}; //采样e1
                 10'd100+633: douta <= {`R11_TO_R2,4'd0,4'd1,4'd4,`Poly_Enable,`PolyAdd}; //u[1]+e[1]
                 10'd101+633: douta <= {`R2_TO_R1,4'd4,4'd0,4'd5,`Poly_Enable,`Compress10}; //Compress10
       
                 //AT 02r2 + AT 01r1 + AT 00r0
                 10'd102+633: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101000}; //采样 AT02
                 10'd103+633: douta <= {`R2_TO_R1 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //A02 s2  PWM1
                 10'd104+633: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd4,`Poly_Enable,`PWM2};   //A02 s2  PWM2
       
                 10'd105+633: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100100}; //采样 AT01
                 10'd106+633: douta <= {`R2_TO_R1 ,4'd0, 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //AT01 r1  PWM1
                 10'd107+633: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //AT01 r1  PWM2
       
                 10'd108+633: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100000}; //采样 AT00
                 10'd109+633: douta <= {`R2_TO_R1 ,4'd0, 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //AT00 r0  PWM1
                 10'd110+633: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //AT00 r0  PWM2
       
                 10'd111+633: douta <= {`R22_TO_R1,4'd4,4'd5,4'd0,`Poly_Enable,`PolyAdd};  //AT02r2 + AT01r1
                 10'd112+633: douta <= {`R12_TO_R2,4'd0,4'd6,4'd0,`Poly_Enable,`PolyAdd};  //AT02r2 + AT01r1 + AT00r0
                 10'd113+633: douta <= {`R2_TO_R1 ,4'd0,4'd0,4'd0,`Poly_Enable,`INTT};
       
                 10'd114+633: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010011}; //采样e0
                 10'd115+633: douta <= {`R11_TO_R2,4'd0,4'd1,4'd4,`Poly_Enable,`PolyAdd}; //u[0]+e[0]
                 10'd116+633: douta <= {`R2_TO_R1,4'd4,4'd0,4'd4,`Poly_Enable,`Compress10}; //Compress10

                 10'd750: douta <= `void_inst ;

//DEC 768 PKE
                 10'd751: douta <= {`R2_TO_R1,4'd10,4'd0,4'd4,`Poly_Enable,`Decompress10}; //Decompress10
                 10'd121+631: douta <= {`R2_TO_R1,4'd11,4'd0,4'd5,`Poly_Enable,`Decompress10}; //Decompress10
                 10'd122+631: douta <= {`R2_TO_R1,4'd12,4'd0,4'd6,`Poly_Enable,`Decompress10}; //Decompress10
                 10'd123+631: douta <= {`R2_TO_R1,4'd13,4'd0,4'd7,`Poly_Enable,`Decompress4}; //Decompress4
           
                
           
                 10'd124+631: douta <= {`R1_TO_R2 ,4'd4, 4'd0 ,4'd4,`Poly_Enable,`NTT}; //NTT U0
                 10'd125+631: douta <= {`R1_TO_R2 ,4'd5, 4'd0 ,4'd5,`Poly_Enable,`NTT}; //NTT u1
                 10'd126+631: douta <= {`R1_TO_R2 ,4'd6, 4'd0 ,4'd6,`Poly_Enable,`NTT}; //NTT u2
           
                 10'd127+631: douta <= {`R2_TO_R1 ,4'd1, 4'd6 ,4'd0,`Poly_Enable,`PWM1};   //u2 s2  PWM1
                 10'd128+631: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //u2 s2  PWM2
           
                 10'd129+631: douta <= {`R2_TO_R1 ,4'd2, 4'd5 ,4'd0,`Poly_Enable,`PWM1};   //u1 s1  PWM1
                 10'd130+631: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //u1 s1  PWM2
           
                 10'd131+631: douta <= {`R2_TO_R1 ,4'd3, 4'd4 ,4'd0,`Poly_Enable,`PWM1};   //u0 s0  PWM1
                 10'd132+631: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd4,`Poly_Enable,`PWM2};   //u0 s0  PWM2
                 
                 10'd133+631: douta <= {`R22_TO_R1,4'd4,4'd5,4'd0,`Poly_Enable,`PolyAdd};  //u0s0 + u1s1
                 10'd134+631: douta <= {`R12_TO_R2,4'd0,4'd6,4'd0,`Poly_Enable,`PolyAdd};  //u0s0 + u1s1 + u2s2
           
                 10'd135+631: douta <= {`R2_TO_R1 ,4'd0,4'd0,4'd0,`Poly_Enable,`INTT}; //INTT
                // 10'd136: douta <= `void_inst;
                 10'd767: douta <= {3'B000 ,4'd0, 4'd7 ,4'd15,`Poly_Enable,`Decode_SUB}; //解密
                 10'd768: douta <= `void_inst ;

//enc 1024 pke 

                 10'd769: douta <= {3'b100 ,4'd12, 4'd0 ,4'd0,`SHA3_Enable,6'B010011}; //采样s3
                 10'd409+361 : douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010010}; //采样s2
                 10'd410+361 : douta <= {3'b100 ,4'd12, 4'd0 ,4'd2,`SHA3_Enable,6'B010001}; //采样s1
                 10'd411+361 : douta <= {3'b100 ,4'd12, 4'd0 ,4'd3,`SHA3_Enable,6'B010000}; //采样s0

                 10'd412+361 : douta <= {`R1_TO_R2 ,4'd0, 4'd0 ,4'd1,`Poly_Enable,`NTT}; //NTT s3
                 10'd413+361 : douta <= {`R1_TO_R2 ,4'd1, 4'd0 ,4'd2,`Poly_Enable,`NTT}; //NTT s2
                 10'd414+361 : douta <= {`R1_TO_R2 ,4'd2, 4'd0 ,4'd3,`Poly_Enable,`NTT}; //NTT s1
                 10'd415+361 : douta <= {`R1_TO_R2 ,4'd3, 4'd0 ,4'd4,`Poly_Enable,`NTT}; //NTT s0

                 10'd416+361 : douta <= {`R2_TO_R1 ,4'd10, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //t3 s3  PWM1
                 10'd417+361 : douta <= {`R1_TO_R2 ,4'd0 , 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //t3 s3  PWM2

                 10'd418+361 : douta <= {`R2_TO_R1 ,4'd9 , 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //t2 s2  PWM1
                 10'd419+361 : douta <= {`R1_TO_R2 ,4'd0 , 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //t2 s2  PWM2
                 10'd420+361 : douta <= {`R22_TO_R1,4'd5, 4'd6,4'd2,`Poly_Enable,`PolyAdd};  //t3 s3  + t2 s2

                 10'd421+361 : douta <= {`R2_TO_R1 ,4'd8 , 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //t3 s3  PWM1
                 10'd422+361 : douta <= {`R1_TO_R2 ,4'd0 , 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //t3 s3  PWM2

                 10'd423+361 : douta <= {`R2_TO_R1 ,4'd7 , 4'd4 ,4'd0,`Poly_Enable,`PWM1};   //t2 s2  PWM1
                 10'd424+361 : douta <= {`R1_TO_R2 ,4'd0 , 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //t2 s2  PWM2
                 10'd425+361 : douta <= {`R22_TO_R1,4'd5, 4'd6,4'd3,`Poly_Enable,`PolyAdd};  //t1 s1  + t0 s0

                 10'd426+361 : douta <= {`R11_TO_R2,4'd2, 4'd3,4'd5,`Poly_Enable,`PolyAdd}; //t3 s3  + t2 s2 + t1 s1  + t0 s0

                 10'd427+361 : douta <= {`R2_TO_R1 ,4'd5 , 4'd4 ,4'd0,`Poly_Enable,`INTT}; //INTT tr
                 10'd428+361 : douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B011111}; //采样e3
                 10'd429+361 : douta <= {3'b000,4'd0, 4'd1,4'd0,`Poly_Enable,`Encode_ADD}; //encode tr 
                 10'd430+361 : douta <= {`R2_TO_R1,4'd0, 4'd0,4'd7,`Poly_Enable,`Compress5}; //compress5 tr 
                 
                 //Ar3
                 10'd431+361 : douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101111}; //采样 AT33
                 10'd432+361 : douta <= {`R2_TO_R1 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //AT33 s3  PWM1
                 10'd433+361 : douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //AT33 s3  PWM2

                 10'd434+361 : douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101011}; //采样 AT32
                 10'd435+361 : douta <= {`R2_TO_R1 ,4'd0, 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //AT32 s2  PWM1
                 10'd436+361 : douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //AT32 s2  PWM2

                 10'd437+361 : douta <= {`R22_TO_R1,4'd5, 4'd6,4'd2,`Poly_Enable,`PolyAdd}; //AT33 s3  + A32 s2

                 10'd438+361 : douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100111}; //采样 AT31
                 10'd439+361 : douta <= {`R2_TO_R1 ,4'd0, 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //AT31 s1  PWM1
                 10'd440+361 : douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //AT31 s1  PWM2

                 10'd441+361 : douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100011}; //采样 AT30
                 10'd442+361 : douta <= {`R2_TO_R1 ,4'd0, 4'd4 ,4'd0,`Poly_Enable,`PWM1};   //AT30 s0  PWM1
                 10'd443+361 : douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //AT30 s0  PWM2

                 10'd444+361 : douta <= {`R22_TO_R1,4'd5, 4'd6,4'd3,`Poly_Enable,`PolyAdd}; //AT31 s1  + AT30 s0

                 10'd445+361 : douta <= {`R11_TO_R2,4'd2, 4'd3,4'd5,`Poly_Enable,`PolyAdd}; //AT33 s3  + AT32 s2 + AT31 s1  + AT30 s0
                 10'd446+361 : douta <= {`R2_TO_R1 ,4'd5 , 4'd4 ,4'd0,`Poly_Enable,`INTT}; //INTT As3

                 10'd447+361 : douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010111};  //采样 e3
                 10'd448+361 : douta <= {`R11_TO_R2,4'd0, 4'd1,4'd0,`Poly_Enable,`PolyAdd};  //t3
                 10'd449+361 : douta <= {`R2_TO_R1,4'd0, 4'd1,4'd6,`Poly_Enable,`Compress11};//t3  Compress11

                 //Ar2
                 10'd450+361 : douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101110}; //采样 AT23
                 10'd451+361 : douta <= {`R2_TO_R1 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //AT23 s3  PWM1
                 10'd452+361 : douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //AT23 s3  PWM2

                 10'd453+361 : douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101010}; //采样 AT22
                 10'd454+361 : douta <= {`R2_TO_R1 ,4'd0, 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //AT22 s2  PWM1
                 10'd455+361 : douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //AT22 s2  PWM2

                 10'd456+361 : douta <= {`R22_TO_R1,4'd5, 4'd6,4'd2,`Poly_Enable,`PolyAdd}; //AT23 s3  + A22 s2

                 10'd457+361 : douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100110}; //采样 AT21
                 10'd458+361 : douta <= {`R2_TO_R1 ,4'd0, 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //AT21 s1  PWM1
                 10'd459+361 : douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //AT21 s1  PWM2

                 10'd460+361 : douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100010}; //采样 AT20
                 10'd461+361 : douta <= {`R2_TO_R1 ,4'd0, 4'd4 ,4'd0,`Poly_Enable,`PWM1};   //AT20 s0  PWM1
                 10'd462+361 : douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //AT20 s0  PWM2

                 10'd463+361 : douta <= {`R22_TO_R1,4'd5, 4'd6,4'd3,`Poly_Enable,`PolyAdd}; //AT21 s1  + AT20 s0

                 10'd464+361 : douta <= {`R11_TO_R2,4'd2, 4'd3,4'd5,`Poly_Enable,`PolyAdd}; //AT23 s3  + AT22 s2 + AT21 s1  + AT20 s0
                 10'd465+361 : douta <= {`R2_TO_R1 ,4'd5 , 4'd4 ,4'd0,`Poly_Enable,`INTT};  //INTT As2

                 10'd466+361 : douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010110};  //采样 e2
                 10'd467+361 : douta <= {`R11_TO_R2,4'd0, 4'd1,4'd0,`Poly_Enable,`PolyAdd};  //t2
                 10'd468+361 : douta <= {`R2_TO_R1,4'd0, 4'd1,4'd5,`Poly_Enable,`Compress11};//t2  Compress11

                 //Ar1
                 10'd469+361 : douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101101}; //采样 AT13
                 10'd470+361 : douta <= {`R2_TO_R1 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //AT13 s3  PWM1
                 10'd471+361 : douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //AT13 s3  PWM2

                 10'd472+361 : douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101001}; //采样 AT12
                 10'd473+361 : douta <= {`R2_TO_R1 ,4'd0, 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //AT12 s2  PWM1
                 10'd474+361 : douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //AT12 s2  PWM2

                 10'd475+361 : douta <= {`R22_TO_R1,4'd5, 4'd6,4'd2,`Poly_Enable,`PolyAdd}; //AT13 s3  + A12 s2

                 10'd476+361 : douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100101}; //采样 AT11
                 10'd477+361 : douta <= {`R2_TO_R1 ,4'd0, 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //AT11 s1  PWM1
                 10'd478+361 : douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //AT11 s1  PWM2

                 10'd479+361 : douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100001}; //采样 AT10
                 10'd480+361 : douta <= {`R2_TO_R1 ,4'd0, 4'd4 ,4'd0,`Poly_Enable,`PWM1};   //AT10 s0  PWM1
                 10'd481+361 : douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //AT10 s0  PWM2

                 10'd482+361 : douta <= {`R22_TO_R1,4'd5, 4'd6,4'd3,`Poly_Enable,`PolyAdd}; //AT11 s1  + AT10 s0

                 10'd483+361 : douta <= {`R11_TO_R2,4'd2, 4'd3,4'd5,`Poly_Enable,`PolyAdd}; //AT13 s3  + AT12 s2 + AT11 s1  + AT10 s0
                 10'd484+361 : douta <= {`R2_TO_R1 ,4'd5 , 4'd4 ,4'd0,`Poly_Enable,`INTT}; //INTT As1

                 10'd485+361 : douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010101};  //采样 e1
                 10'd486+361 : douta <= {`R11_TO_R2,4'd0, 4'd1,4'd0,`Poly_Enable,`PolyAdd};  //t1
                 10'd487+361 : douta <= {`R2_TO_R1,4'd0, 4'd1,4'd4,`Poly_Enable,`Compress11};//t1  Compress11

                 //Ar1
                 10'd488+361: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101100}; //采样 AT03
                 10'd489+361: douta <= {`R2_TO_R1 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //AT03 s3  PWM1
                 10'd490+361: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //AT03 s3  PWM2

                 10'd491+361: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B101000}; //采样 AT02
                 10'd492+361: douta <= {`R2_TO_R1 ,4'd0, 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //AT02 s2  PWM1
                 10'd493+361: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //AT02 s2  PWM2

                 10'd494+361: douta <= {`R22_TO_R1,4'd5, 4'd6,4'd2,`Poly_Enable,`PolyAdd}; //AT13 s3  + A12 s2

                 10'd495+361: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100100}; //采样 AT01
                 10'd496+361: douta <= {`R2_TO_R1 ,4'd0, 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //AT01 s1  PWM1
                 10'd497+361: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd5,`Poly_Enable,`PWM2};   //AT01 s1  PWM2

                 10'd498+361: douta <= {3'b101 ,4'd9, 4'd0 ,4'd0,`SHA3_Enable,6'B100000}; //采样 AT00
                 10'd499+361: douta <= {`R2_TO_R1 ,4'd0, 4'd4 ,4'd0,`Poly_Enable,`PWM1};   //AT00 s0  PWM1
                 10'd500+361: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd6,`Poly_Enable,`PWM2};   //AT00 s0  PWM2

                 10'd501+361: douta <= {`R22_TO_R1,4'd5, 4'd6,4'd3,`Poly_Enable,`PolyAdd}; //AT01 s1  + AT00 s0

                 10'd502+361: douta <= {`R11_TO_R2,4'd2, 4'd3,4'd5,`Poly_Enable,`PolyAdd}; //AT03 s3  + AT02 s2 + AT01 s1  + AT00 s0
                 10'd503+361: douta <= {`R2_TO_R1 ,4'd5 , 4'd4 ,4'd0,`Poly_Enable,`INTT}; //INTT As0

                 10'd504+361: douta <= {3'b100 ,4'd12, 4'd0 ,4'd1,`SHA3_Enable,6'B010100};  //采样 e0
                 10'd505+361: douta <= {`R11_TO_R2,4'd0, 4'd1,4'd0,`Poly_Enable,`PolyAdd};  //t0
                 10'd506+361: douta <= {`R2_TO_R1,4'd0, 4'd1,4'd3,`Poly_Enable,`Compress11};//t0  Compress11

                 10'd868: douta <= `void_inst ;

//dec 1024 pke
                 10'd869: douta <= {`R2_TO_R1,4'd11,4'd0,4'd3,`Poly_Enable,`Decompress11}; //Decompress11
                 10'd509+361: douta <= {`R2_TO_R1,4'd12,4'd0,4'd4,`Poly_Enable,`Decompress11}; //Decompress11
                 10'd510+361: douta <= {`R2_TO_R1,4'd13,4'd0,4'd5,`Poly_Enable,`Decompress11}; //Decompress11
                 10'd511+361: douta <= {`R2_TO_R1,4'd14,4'd0,4'd6,`Poly_Enable,`Decompress11}; //Decompress11
                 10'd512+361: douta <= {`R2_TO_R1,4'd6 ,4'd0,4'd7,`Poly_Enable,`Decompress5}; //Decompress5
   
                 10'd513+361: douta <= {`R1_TO_R2 ,4'd6, 4'd0 ,4'd0,`Poly_Enable,`NTT}; //NTT u3
                 10'd514+361: douta <= {`R2_TO_R1 ,4'd0, 4'd1 ,4'd0,`Poly_Enable,`PWM1};   //u3 s3  PWM1
                 10'd515+361: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd1,`Poly_Enable,`PWM2};   //u3 s3  PWM2
   
                 10'd516+361: douta <= {`R1_TO_R2 ,4'd5, 4'd0 ,4'd0,`Poly_Enable,`NTT}; //NTT u2
                 10'd517+361: douta <= {`R2_TO_R1 ,4'd0, 4'd2 ,4'd0,`Poly_Enable,`PWM1};   //u2 s2  PWM1
                 10'd518+361: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd2,`Poly_Enable,`PWM2};   //u2 s2  PWM2
   
                 10'd519+361: douta <= {`R1_TO_R2 ,4'd4, 4'd0 ,4'd0,`Poly_Enable,`NTT}; //NTT u1
                 10'd520+361: douta <= {`R2_TO_R1 ,4'd0, 4'd3 ,4'd0,`Poly_Enable,`PWM1};   //u1 s1  PWM1
                 10'd521+361: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd3,`Poly_Enable,`PWM2};   //u1 s1  PWM2
   
                 10'd522+361: douta <= {`R1_TO_R2 ,4'd3, 4'd0 ,4'd0,`Poly_Enable,`NTT}; //NTT u0
                 10'd523+361: douta <= {`R2_TO_R1 ,4'd0, 4'd4 ,4'd0,`Poly_Enable,`PWM1};   //u0 s0  PWM1
                 10'd524+361: douta <= {`R1_TO_R2 ,4'd0, 4'd1 ,4'd4,`Poly_Enable,`PWM2};   //u0 s0  PWM2
   
                 10'd525+361: douta <= {`R22_TO_R1,4'd1, 4'd2,4'd0,`Poly_Enable,`PolyAdd}; //u3 s3 + u2 s2
                 10'd526+361: douta <= {`R22_TO_R1,4'd3, 4'd4,4'd1,`Poly_Enable,`PolyAdd}; //u1 s1 + u0 s0
                 10'd527+361: douta <= {`R11_TO_R2,4'd0, 4'd1,4'd0,`Poly_Enable,`PolyAdd}; //u1 s1 + u0 s0
                 10'd528+361: douta <= {`R2_TO_R1 ,4'd0, 4'd0 ,4'd0,`Poly_Enable,`INTT};   //INTT su
                 10'd529+361: douta <= {3'B000 ,4'd0, 4'd7 ,4'd15,`Poly_Enable,`Decode_SUB}; //解密
                 10'd891: douta <= `void_inst ;
                default:		douta <= 32'b0;
			endcase // addr
		end
		else
			douta <= douta;
	end

endmodule

module instrom_tb;

reg clk,en;
wire [21:0] out;
reg [9:0] addr;
 ins_rom  theinstrom(
.clka(clk),
.ena(en),
.douta(out),
.addra(addr));

integer inst_rom;


integer i;
initial
 begin
    inst_rom = $fopen("D:/DeskTop/PQC/src/2022_10_11/Hardware/DATA/new_inst.txt","w");
    addr=10'd0;
    en =1;   
    clk=0;
 end

 reg we_en;

 always@(posedge clk) we_en <= en;

 always@(posedge clk)  addr<=addr+1;

 always@(posedge clk)
 begin
    if(we_en && addr<= 10'd902)  $fwrite(inst_rom,"%b\n",out);
 end
always@(posedge clk) if(addr>=10'd902) en=0;

always #5 clk =~clk;
endmodule